Class ConnectionStatistics
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.io.ConnectionStatistics
- All Implemented Interfaces:
Connection.Listener, Dumpable, LifeCycle
- Direct Known Subclasses:
IncludeExcludeConnectionStatistics, ServerConnectionStatistics
@ManagedObject("Tracks statistics on connections")
public class ConnectionStatistics
extends AbstractLifeCycle
implements Connection.Listener, Dumpable
A Connection.Listener that tracks connection statistics.
Adding an instance of this class as a bean to a server Connector (for the server) or to HttpClient (for the client) will trigger the tracking of the connection statistics for all connections managed by the server Connector or by HttpClient.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface Connection.Listener
Connection.Listener.AdapterNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LongAdderprivate final RateCounterprivate final LongAdderprivate final RateCounterprivate final CounterStatisticprivate final SampleStatisticprivate final LongAdderprivate final RateCounterprivate final LongAdderprivate final RateCounter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()dump()voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.longdoubledoublelonglonglonglonglonglonglonglonglonglonglongvoidonClosed(Connection connection) voidonOpened(Connection connection) voidreset()toString()Methods inherited from class AbstractLifeCycle
addLifeCycleListener, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
Field Details
-
_connections
-
_connectionsDuration
-
_bytesIn
-
_bytesOut
-
_messagesIn
-
_messagesOut
-
_bytesInRate
-
_bytesOutRate
-
_messagesInRate
-
_messagesOutRate
-
-
Constructor Details
-
ConnectionStatistics
public ConnectionStatistics()
-
-
Method Details
-
reset
-
doStart
- Overrides:
doStartin classAbstractLifeCycle- Throws:
Exception
-
onOpened
- Specified by:
onOpenedin interfaceConnection.Listener
-
onClosed
- Specified by:
onClosedin interfaceConnection.Listener
-
getReceivedBytes
@ManagedAttribute("Total number of bytes received by tracked connections") public long getReceivedBytes() -
getReceivedBytesRate
@ManagedAttribute("Total number of bytes received per second since the last invocation of this method") public long getReceivedBytesRate() -
getSentBytes
-
getSentBytesRate
@ManagedAttribute("Total number of bytes sent per second since the last invocation of this method") public long getSentBytesRate() -
getConnectionDurationMax
-
getConnectionDurationMean
@ManagedAttribute("The mean duration of a connection in ms") public double getConnectionDurationMean() -
getConnectionDurationStdDev
@ManagedAttribute("The standard deviation of the duration of a connection") public double getConnectionDurationStdDev() -
getConnectionsTotal
-
getConnections
-
getConnectionsMax
-
getReceivedMessages
-
getReceivedMessagesRate
@ManagedAttribute("Total number of messages received per second since the last invocation of this method") public long getReceivedMessagesRate() -
getSentMessages
-
getSentMessagesRate
@ManagedAttribute("Total number of messages sent per second since the last invocation of this method") public long getSentMessagesRate() -
dump
-
dump
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
toString
- Overrides:
toStringin classAbstractLifeCycle
-