# Class LLMetricsService

java.lang.Object
com.io7m.looseleaf.server.internal.LLMetricsService

All Implemented Interfaces:
  `com.io7m.repetoir.core.RPServiceType`

public final class LLMetricsService extends Object implements com.io7m.repetoir.core.RPServiceType
A metrics service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LLMetricsService(LLDatabaseService inDatabase, LLTelemetryServiceType telemetry)`
  A metrics service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDBTime(Duration time)`
  Set the most recent DB time.
  `long`
  `deletes()`
  `String`
  `description()`
  `void`
  `logAuthError(String address)`
  Log an authentication error.
  `void`
  `logAuthErrorNamed(LLUserName userName, String address)`
  Log an authentication error.
  `void`
  `logDelete(LLUser user, String key)`
  Log a delete operation.
  `void`
  `logError(LLUser user, String message)`
  Log an error.
  `void`
  `logRead(LLUser user, String key)`
  Log a read operation.
  `void`
  `logRequest()`
  Log a request.
  `void`
  `logRequest4xx()`
  Log 4xx response.
  `void`
  `logRequest5xx()`
  Log 5xx response.
  `void`
  `logRequestTime(Duration time)`
  Log a request time.
  `void`
  `logUpdate(LLUser user, String key)`
  Log a write operation.
  `long`
  `reads()`
  `String`
  `toString()`
  `long`
  `writes()`

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

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

- ## Constructor Details

  - ### LLMetricsService

    public LLMetricsService(LLDatabaseService inDatabase, LLTelemetryServiceType telemetry)
    A metrics service.
    Parameters:
      `inDatabase` - The database service
      `telemetry` - The telemetry service

- ## Method Details

  - ### description

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

  - ### reads

    public long reads()
    Returns:
      The number of reads so far

  - ### writes

    public long writes()
    Returns:
      The number of writes so far

  - ### deletes

    public long deletes()
    Returns:
      The number of deletes so far

  - ### toString

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

  - ### addDBTime

    public void addDBTime(Duration time)
    Set the most recent DB time.
    Parameters:
      `time` - The time

  - ### logError

    public void logError(LLUser user, String message)
    Log an error.
    Parameters:
      `user` - The user
      `message` - The error message

  - ### logRead

    public void logRead(LLUser user, String key)
    Log a read operation.
    Parameters:
      `user` - The user
      `key` - The database key

  - ### logUpdate

    public void logUpdate(LLUser user, String key)
    Log a write operation.
    Parameters:
      `user` - The user
      `key` - The database key

  - ### logDelete

    public void logDelete(LLUser user, String key)
    Log a delete operation.
    Parameters:
      `user` - The user
      `key` - The database key

  - ### logAuthError

    public void logAuthError(String address)
    Log an authentication error.
    Parameters:
      `address` - The remote host

  - ### logAuthErrorNamed

    public void logAuthErrorNamed(LLUserName userName, String address)
    Log an authentication error.
    Parameters:
      `userName` - The user name
      `address` - The remote host

  - ### logRequestTime

    public void logRequestTime(Duration time)
    Log a request time.
    Parameters:
      `time` - The time

  - ### logRequest4xx

    public void logRequest4xx()
    Log 4xx response.

  - ### logRequest5xx

    public void logRequest5xx()
    Log 5xx response.

  - ### logRequest

    public void logRequest()
    Log a request.