Package com.io7m.cardant.server.service.telemetry.api

# Class CAMetricsService

java.lang.Object
com.io7m.cardant.server.service.telemetry.api.CAMetricsService

All Implemented Interfaces:
  `CAMetricsServiceType`, `com.io7m.repetoir.core.RPServiceType`, `AutoCloseable`

public final class CAMetricsService extends Object implements CAMetricsServiceType
The metrics service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CAMetricsService(CAServerTelemetryServiceType telemetry)`
  The metrics service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `String`
  `description()`
  `void`
  `onHttp2xx()`
  An HTTP request resulted in a 2xx success.
  `void`
  `onHttp4xx()`
  An HTTP request resulted in a 4xx error.
  `void`
  `onHttp5xx()`
  An HTTP request resulted in a 5xx error.
  `void`
  `onHttpRequested()`
  An HTTP request was received.
  `void`
  `onHttpRequestSize(long size)`
  An HTTP request was received of a given size.
  `void`
  `onHttpResponseSize(long size)`
  An HTTP response was produced of a given size.
  `void`
  `onHttpResponseTime(Duration time)`
  An HTTP response was produced in the given time.
  `void`
  `onLogin(long sizeNow)`
  A login session was created.
  `void`
  `onLoginClosed(long sizeNow)`
  A login session was closed.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CAMetricsService

    public CAMetricsService(CAServerTelemetryServiceType telemetry)
    The metrics service.
    Parameters:
      `telemetry` - The underlying telemetry system

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### description

    public String description()
    Specified by:
      `description` in interface `com.io7m.repetoir.core.RPServiceType`

  - ### close

    public void close() throws Exception
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `Exception`

  - ### onHttpRequested

    public void onHttpRequested()
    Description copied from interface: `CAMetricsServiceType`
    An HTTP request was received.
    Specified by:
      `onHttpRequested` in interface `CAMetricsServiceType`

  - ### onHttp5xx

    public void onHttp5xx()
    Description copied from interface: `CAMetricsServiceType`
    An HTTP request resulted in a 5xx error.
    Specified by:
      `onHttp5xx` in interface `CAMetricsServiceType`

  - ### onHttp2xx

    public void onHttp2xx()
    Description copied from interface: `CAMetricsServiceType`
    An HTTP request resulted in a 2xx success.
    Specified by:
      `onHttp2xx` in interface `CAMetricsServiceType`

  - ### onHttp4xx

    public void onHttp4xx()
    Description copied from interface: `CAMetricsServiceType`
    An HTTP request resulted in a 4xx error.
    Specified by:
      `onHttp4xx` in interface `CAMetricsServiceType`

  - ### onHttpRequestSize

    public void onHttpRequestSize(long size)
    Description copied from interface: `CAMetricsServiceType`
    An HTTP request was received of a given size.
    Specified by:
      `onHttpRequestSize` in interface `CAMetricsServiceType`
    Parameters:
      `size` - The size

  - ### onHttpResponseSize

    public void onHttpResponseSize(long size)
    Description copied from interface: `CAMetricsServiceType`
    An HTTP response was produced of a given size.
    Specified by:
      `onHttpResponseSize` in interface `CAMetricsServiceType`
    Parameters:
      `size` - The size

  - ### onHttpResponseTime

    public void onHttpResponseTime(Duration time)
    Description copied from interface: `CAMetricsServiceType`
    An HTTP response was produced in the given time.
    Specified by:
      `onHttpResponseTime` in interface `CAMetricsServiceType`
    Parameters:
      `time` - The time

  - ### onLogin

    public void onLogin(long sizeNow)
    Description copied from interface: `CAMetricsServiceType`
    A login session was created.
    Specified by:
      `onLogin` in interface `CAMetricsServiceType`
    Parameters:
      `sizeNow` - The number of active sessions now

  - ### onLoginClosed

    public void onLoginClosed(long sizeNow)
    Description copied from interface: `CAMetricsServiceType`
    A login session was closed.
    Specified by:
      `onLoginClosed` in interface `CAMetricsServiceType`
    Parameters:
      `sizeNow` - The number of active sessions now