Package org.eclipse.jetty.io
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:
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 org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection.Listener
Connection.Listener.Adapter
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLong
_bytesInStamp
private java.util.concurrent.atomic.AtomicLong
_bytesOutStamp
private CounterStatistic
_connections
private SampleStatistic
_connectionsDuration
private java.util.concurrent.atomic.LongAdder
_messagesIn
private java.util.concurrent.atomic.AtomicLong
_messagesInStamp
private java.util.concurrent.atomic.LongAdder
_messagesOut
private java.util.concurrent.atomic.AtomicLong
_messagesOutStamp
private java.util.concurrent.atomic.LongAdder
_rcvdBytes
private java.util.concurrent.atomic.LongAdder
_sentBytes
-
Constructor Summary
Constructors Constructor Description ConnectionStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
java.lang.String
dump()
void
dump(java.lang.Appendable out, java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.long
getConnectionDurationMax()
double
getConnectionDurationMean()
double
getConnectionDurationStdDev()
long
getConnections()
long
getConnectionsMax()
long
getConnectionsTotal()
long
getReceivedBytes()
long
getReceivedBytesRate()
long
getReceivedMessages()
long
getReceivedMessagesRate()
long
getSentBytes()
long
getSentBytesRate()
long
getSentMessages()
long
getSentMessagesRate()
void
onClosed(Connection connection)
void
onOpened(Connection connection)
void
reset()
java.lang.String
toString()
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
-
-
-
Field Detail
-
_connections
private final CounterStatistic _connections
-
_connectionsDuration
private final SampleStatistic _connectionsDuration
-
_rcvdBytes
private final java.util.concurrent.atomic.LongAdder _rcvdBytes
-
_bytesInStamp
private final java.util.concurrent.atomic.AtomicLong _bytesInStamp
-
_sentBytes
private final java.util.concurrent.atomic.LongAdder _sentBytes
-
_bytesOutStamp
private final java.util.concurrent.atomic.AtomicLong _bytesOutStamp
-
_messagesIn
private final java.util.concurrent.atomic.LongAdder _messagesIn
-
_messagesInStamp
private final java.util.concurrent.atomic.AtomicLong _messagesInStamp
-
_messagesOut
private final java.util.concurrent.atomic.LongAdder _messagesOut
-
_messagesOutStamp
private final java.util.concurrent.atomic.AtomicLong _messagesOutStamp
-
-
Method Detail
-
reset
@ManagedOperation(value="Resets the statistics", impact="ACTION") public void reset()
-
doStart
protected void doStart() throws java.lang.Exception
- Overrides:
doStart
in classAbstractLifeCycle
- Throws:
java.lang.Exception
-
onOpened
public void onOpened(Connection connection)
- Specified by:
onOpened
in interfaceConnection.Listener
-
onClosed
public void onClosed(Connection connection)
- Specified by:
onClosed
in 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
@ManagedAttribute("Total number of bytes sent by tracked connections") public long getSentBytes()
-
getSentBytesRate
@ManagedAttribute("Total number of bytes sent per second since the last invocation of this method") public long getSentBytesRate()
-
getConnectionDurationMax
@ManagedAttribute("The max duration of a connection in ms") public long 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
@ManagedAttribute("The total number of connections opened") public long getConnectionsTotal()
-
getConnections
@ManagedAttribute("The current number of open connections") public long getConnections()
-
getConnectionsMax
@ManagedAttribute("The max number of open connections") public long getConnectionsMax()
-
getReceivedMessages
@ManagedAttribute("The total number of messages received") public long getReceivedMessages()
-
getReceivedMessagesRate
@ManagedAttribute("Total number of messages received per second since the last invocation of this method") public long getReceivedMessagesRate()
-
getSentMessages
@ManagedAttribute("The total number of messages sent") public long getSentMessages()
-
getSentMessagesRate
@ManagedAttribute("Total number of messages sent per second since the last invocation of this method") public long getSentMessagesRate()
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Description copied from interface:Dumpable
Dump 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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractLifeCycle
-
-