Class CountingInstrumenter

java.lang.Object
io.fusionauth.http.server.CountingInstrumenter
All Implemented Interfaces:
Instrumenter

public class CountingInstrumenter extends Object implements Instrumenter
A simple counting instrumenter for the HTTPServer. This is not thread safe, so if you need accurate data, you'll want to use the ThreadSafeCountingInstrumenter.
Author:
Brian Pontarelli
  • Constructor Details

    • CountingInstrumenter

      public CountingInstrumenter()
  • Method Details

    • acceptedConnection

      public void acceptedConnection()
      Description copied from interface: Instrumenter
      Called when a new client connection is accepted by the HTTP server.
      Specified by:
      acceptedConnection in interface Instrumenter
    • acceptedRequest

      public void acceptedRequest()
      Description copied from interface: Instrumenter
      Called when a new request is accepted by an HTTP worker.
      Specified by:
      acceptedRequest in interface Instrumenter
    • badRequest

      public void badRequest()
      Description copied from interface: Instrumenter
      Called when a client sends in a bad HTTP request. A bad request is one that cannot be handled by the HTTP server.
      Specified by:
      badRequest in interface Instrumenter
    • chunkedRequest

      public void chunkedRequest()
      Description copied from interface: Instrumenter
      Called when a client sends in chunked request data.
      Specified by:
      chunkedRequest in interface Instrumenter
    • chunkedResponse

      public void chunkedResponse()
      Description copied from interface: Instrumenter
      Called when a client sends in chunked request data.
      Specified by:
      chunkedResponse in interface Instrumenter
    • connectionClosed

      public void connectionClosed()
      Description copied from interface: Instrumenter
      Called when a connection is closed due to an issue or a timeout. This should not count connections closed in expected conditions such as a keep-alive timeout.
      Specified by:
      connectionClosed in interface Instrumenter
    • getAcceptedRequests

      public long getAcceptedRequests()
    • getBadRequests

      public long getBadRequests()
    • getBytesRead

      public long getBytesRead()
    • getBytesWritten

      public long getBytesWritten()
    • getChunkedRequests

      public long getChunkedRequests()
    • getChunkedResponses

      public long getChunkedResponses()
    • getClosedConnections

      public long getClosedConnections()
    • getConnections

      public long getConnections()
    • getServers

      public long getServers()
    • getWorkers

      public long getWorkers()
    • readFromClient

      public void readFromClient(long bytes)
      Description copied from interface: Instrumenter
      Called when bytes are read from a client.
      Specified by:
      readFromClient in interface Instrumenter
      Parameters:
      bytes - The number of bytes read.
    • serverStarted

      public void serverStarted()
      Description copied from interface: Instrumenter
      Called when the server listener is started. If you have a single listener, you will have one server started. If you have two listeners, one for HTTP and one for HTTPS, you will have two servers started.
      Specified by:
      serverStarted in interface Instrumenter
    • workerStarted

      public void workerStarted()
      Description copied from interface: Instrumenter
      Signals that an HTTP worker has been started.
      Specified by:
      workerStarted in interface Instrumenter
    • workerStopped

      public void workerStopped()
      Description copied from interface: Instrumenter
      Signals that an HTTP worker has been stopped.
      Specified by:
      workerStopped in interface Instrumenter
    • wroteToClient

      public void wroteToClient(long bytes)
      Description copied from interface: Instrumenter
      Called when bytes are written to a client.
      Specified by:
      wroteToClient in interface Instrumenter
      Parameters:
      bytes - The number of bytes written.