Package org.opends.server.protocols.http
Class HttpStatistics
java.lang.Object
org.opends.server.protocols.http.HttpStatistics
Collects statistics for HTTP.
-
Field Summary
FieldsModifier and TypeFieldDescriptionHTTP methods supported by Rest2Ldap. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalMeters
(MeterRegistryHolder registry) Computes HTTP statistics meters.long
Returns the number of HTTP requests of any kind that have been processed.getRequestCount
(String httpMethod) Returns the number of HTTP requests of the provided HTTP method that have been processed.void
updateBytesRead
(long bytes) Updates the counter for the number of bytes that have been read from the network.void
updateBytesWritten
(long bytes) Updates the counter for the number of bytes that have been written to the network.void
updateRequestProcessingTime
(String httpMethod, org.forgerock.http.protocol.Status status, long processingTimeMs) Updates statistics once a request has completed.
-
Field Details
-
SUPPORTED_HTTP_METHODS
HTTP methods supported by Rest2Ldap.
-
-
Constructor Details
-
HttpStatistics
public HttpStatistics()
-
-
Method Details
-
addAdditionalMeters
Computes HTTP statistics meters.- Parameters:
registry
- registry where additional meters should be added.
-
updateRequestProcessingTime
public void updateRequestProcessingTime(String httpMethod, org.forgerock.http.protocol.Status status, long processingTimeMs) Updates statistics once a request has completed.- Parameters:
httpMethod
- The HTTP method.status
- The result status.processingTimeMs
- The processing time.
-
getRequestCount
Returns the number of HTTP requests of the provided HTTP method that have been processed.- Parameters:
httpMethod
- AString
representing the http method name. Available methods are (case insensitive) "delete", "get", "patch", "post" and "put".- Returns:
- The number of HTTP requests for the provided HTTP methods that have been processed,
or
null
if the httpMethod is not part of the method listed above.
-
getAllRequestsCount
public long getAllRequestsCount()Returns the number of HTTP requests of any kind that have been processed.- Returns:
- the number of HTTP requests of any kind that have been processed
-
updateBytesRead
public void updateBytesRead(long bytes) Updates the counter for the number of bytes that have been read from the network.- Parameters:
bytes
- The number of bytes read from the network.
-
updateBytesWritten
public void updateBytesWritten(long bytes) Updates the counter for the number of bytes that have been written to the network.- Parameters:
bytes
- The number of bytes written to the network.
-