@ManagedObject(value="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.
AbstractLifeCycle.AbstractLifeCycleListener
Connection.Listener.Adapter
LifeCycle.Listener
Constructor and Description |
---|
ConnectionStatistics() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
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() |
String |
toString() |
addLifeCycleListener, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
@ManagedOperation(value="Resets the statistics", impact="ACTION") public void reset()
protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
public void onOpened(Connection connection)
onOpened
in interface Connection.Listener
public void onClosed(Connection connection)
onClosed
in interface Connection.Listener
@ManagedAttribute(value="Total number of bytes received by tracked connections") public long getReceivedBytes()
@ManagedAttribute(value="Total number of bytes received per second since the last invocation of this method") public long getReceivedBytesRate()
@ManagedAttribute(value="Total number of bytes sent by tracked connections") public long getSentBytes()
@ManagedAttribute(value="Total number of bytes sent per second since the last invocation of this method") public long getSentBytesRate()
@ManagedAttribute(value="The max duration of a connection in ms") public long getConnectionDurationMax()
@ManagedAttribute(value="The mean duration of a connection in ms") public double getConnectionDurationMean()
@ManagedAttribute(value="The standard deviation of the duration of a connection") public double getConnectionDurationStdDev()
@ManagedAttribute(value="The total number of connections opened") public long getConnectionsTotal()
@ManagedAttribute(value="The current number of open connections") public long getConnections()
@ManagedAttribute(value="The max number of open connections") public long getConnectionsMax()
@ManagedAttribute(value="The total number of messages received") public long getReceivedMessages()
@ManagedAttribute(value="Total number of messages received per second since the last invocation of this method") public long getReceivedMessagesRate()
@ManagedAttribute(value="The total number of messages sent") public long getSentMessages()
@ManagedAttribute(value="Total number of messages sent per second since the last invocation of this method") public long getSentMessagesRate()
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
Copyright © 1995-2016 Webtide. All Rights Reserved.