Class ConnectionStatistics

  • All Implemented Interfaces:
    java.util.EventListener, Connection.Listener, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    IncludeExcludeConnectionStatistics

    @ManagedObject("Tracks statistics on connections")
    public class ConnectionStatistics
    extends org.eclipse.jetty.util.component.AbstractLifeCycle
    implements Connection.Listener, org.eclipse.jetty.util.component.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

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

        org.eclipse.jetty.util.component.Dumpable.DumpableContainer
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Detail

      • ConnectionStatistics

        public ConnectionStatistics()
    • Method Detail

      • reset

        @ManagedOperation(value="Resets the statistics",
                          impact="ACTION")
        public void reset()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        java.lang.Exception
      • 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 java.lang.String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.eclipse.jetty.util.component.AbstractLifeCycle