# Class StMetricsService

java.lang.Object
com.io7m.stonesignal.server.telemetry.StMetricsService

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

public final class StMetricsService extends Object implements StMetricsServiceType
The metrics service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StMetricsService(StTelemetryServiceType 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.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### StMetricsService

    public StMetricsService(StTelemetryServiceType 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: `StMetricsServiceType`
    An HTTP request was received.
    Specified by:
      `onHttpRequested` in interface `StMetricsServiceType`

  - ### onHttp5xx

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

  - ### onHttp2xx

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

  - ### onHttp4xx

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

  - ### onHttpRequestSize

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

  - ### onHttpResponseSize

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

  - ### onHttpResponseTime

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