Class IdMetricsService
java.lang.Object
com.io7m.idstore.server.service.telemetry.api.IdMetricsService
- All Implemented Interfaces:
IdMetricsServiceType
,com.io7m.repetoir.core.RPServiceType
,AutoCloseable
The metrics service.
-
Constructor Summary
ConstructorDescriptionIdMetricsService
(IdServerTelemetryServiceType telemetry) The metrics service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
onClosedForMaintenance
(boolean closed) The server is open for business, or closed for maintenance.void
onHttp2xx
(IdUserDomain type) An HTTP request resulted in a 2xx success.void
onHttp4xx
(IdUserDomain type) An HTTP request resulted in a 4xx error.void
onHttp5xx
(IdUserDomain type) An HTTP request resulted in a 5xx error.void
onHttpRequested
(IdUserDomain type) An HTTP request was received.void
onHttpRequestSize
(IdUserDomain type, long size) An HTTP request was received of a given size.void
onHttpResponseSize
(IdUserDomain type, long size) An HTTP response was produced of a given size.void
onHttpResponseTime
(IdUserDomain type, Duration time) An HTTP response was produced in the given time.void
onLogin
(IdUserDomain type, long countNow) A login session was created.void
onLoginClosed
(IdUserDomain type, long countNow) A login session was closed or expired.void
onLoginPauseTime
(IdUserDomain type, Duration duration) The login pause time is known.void
onMailFailed
(IdEmail address, Duration time) Mail could not be sent to the given address.void
onMailSent
(IdEmail address, Duration time) Mail was sent to the given address.void
onRateLimitTriggered
(String name, String host, String user, String operation) A rate limit was triggered.toString()
-
Constructor Details
-
IdMetricsService
The metrics service.- Parameters:
telemetry
- The underlying telemetry system
-
-
Method Details
-
toString
-
description
- Specified by:
description
in interfacecom.io7m.repetoir.core.RPServiceType
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
onHttpRequested
Description copied from interface:IdMetricsServiceType
An HTTP request was received.- Specified by:
onHttpRequested
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domain
-
onHttp5xx
Description copied from interface:IdMetricsServiceType
An HTTP request resulted in a 5xx error.- Specified by:
onHttp5xx
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domain
-
onHttp2xx
Description copied from interface:IdMetricsServiceType
An HTTP request resulted in a 2xx success.- Specified by:
onHttp2xx
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domain
-
onHttp4xx
Description copied from interface:IdMetricsServiceType
An HTTP request resulted in a 4xx error.- Specified by:
onHttp4xx
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domain
-
onHttpRequestSize
Description copied from interface:IdMetricsServiceType
An HTTP request was received of a given size.- Specified by:
onHttpRequestSize
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domainsize
- The size
-
onHttpResponseSize
Description copied from interface:IdMetricsServiceType
An HTTP response was produced of a given size.- Specified by:
onHttpResponseSize
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domainsize
- The size
-
onMailSent
Description copied from interface:IdMetricsServiceType
Mail was sent to the given address.- Specified by:
onMailSent
in interfaceIdMetricsServiceType
- Parameters:
address
- The addresstime
- The time it took
-
onMailFailed
Description copied from interface:IdMetricsServiceType
Mail could not be sent to the given address.- Specified by:
onMailFailed
in interfaceIdMetricsServiceType
- Parameters:
address
- The addresstime
- The time it took
-
onRateLimitTriggered
Description copied from interface:IdMetricsServiceType
A rate limit was triggered.- Specified by:
onRateLimitTriggered
in interfaceIdMetricsServiceType
- Parameters:
name
- The rate namehost
- The hostuser
- The useroperation
- The operation
-
onHttpResponseTime
Description copied from interface:IdMetricsServiceType
An HTTP response was produced in the given time.- Specified by:
onHttpResponseTime
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domaintime
- The time
-
onLogin
Description copied from interface:IdMetricsServiceType
A login session was created.- Specified by:
onLogin
in interfaceIdMetricsServiceType
- Parameters:
type
- The type of sessioncountNow
- The number of sessions now active
-
onLoginClosed
Description copied from interface:IdMetricsServiceType
A login session was closed or expired.- Specified by:
onLoginClosed
in interfaceIdMetricsServiceType
- Parameters:
type
- The type of sessioncountNow
- The number of sessions now active
-
onLoginPauseTime
Description copied from interface:IdMetricsServiceType
The login pause time is known.- Specified by:
onLoginPauseTime
in interfaceIdMetricsServiceType
- Parameters:
type
- The user domainduration
- The pause time
-
onClosedForMaintenance
public void onClosedForMaintenance(boolean closed) Description copied from interface:IdMetricsServiceType
The server is open for business, or closed for maintenance.- Specified by:
onClosedForMaintenance
in interfaceIdMetricsServiceType
- Parameters:
closed
-true
if the server is closed
-