jetty/jetty.project

Improve ConnectionStatistics to report per-protocol information

Open

#4 184 ouverte le 11 oct. 2019

Voir sur GitHub
 (10 commentaires) (0 réactions) (2 assignés)Java (1 913 forks)batch import
EnhancementHelp WantedLow PriorityPinned

Métriques du dépôt

Stars
 (3 701 stars)
Métriques de merge PR
 (Merge moyen 6j 14h) (48 PRs mergées en 30 j)

Description

Currently, ConnectionStatistics listens to the "connection closed" event, and when it happens it retrieves the connection information from the Connection object passed in the event.

Would be great if this information could be split per-protocol.

This would involve:

  1. a new Connection.getProtocol() method so that it would be possible to know what protocol was that connection speaking
  2. a different implementation of ConnectionStatistics to store per-protocol information (as well as the totals)
  3. Possibly a ConnectionStatisticsMBean that displays the per-protocol data in a JMX friendly way. JMX's CompositeType represents a struct; in this case it can have these fields: [protocol, bytesIn, bytesOut, messagesIn, messagesOut]. JMX's CompositeData is an instance of the struct with the actual values for those fields. JMX's TabularData is a Map where you can map a String to a CompositeData (I think - this class is so obscure I completely forgotten it was so obscure). Point being that either via an array of CompositeData, or via TabularData we can return the connection information split by protocol.

Guide contributeur