class DefaultMetrics
A default implementation of ClientMetrics
that exposes the driver events as
Node.js events.
An instance of DefaultMetrics
is configured by default in the client,
you can access this instance using Client#metrics
property.
Members
EventEmitter
errors
Emits all the error events.
Use each of the properties to measure events of specific errors.
EventEmitter
ignoredErrors
Emits events when an error is ignored by the retry policy.
EventEmitter
responses
Emits events when a response message is obtained.
EventEmitter
retries
Emits all the retry events.
Use each of the properties to measure events of specific retries.
EventEmitter
speculativeExecutions
Emits events when a speculative execution is started.
Constructor
DefaultMetrics
()Creates a new instance of DefaultMetrics
.
Methods
Method invoked when an authentication error is obtained from the server.
onClientTimeoutError
(OperationTimedOutError
e)
Method invoked when an error (different than a server or client timeout, authentication or connection error) is encountered when executing a request.
onClientTimeoutRetry
(Error
e)
Method invoked when an execution is retried as a result of a client-level timeout.
onConnectionError
(Error
e)
Method invoked when there is a connection error.
onIgnoreError
(Error
e)
Method invoked when an error is marked as ignored by the retry policy.
onOtherError
(Error
e)
Method invoked when an error (different than a server or client timeout, authentication or connection error) is encountered when executing a request.
onOtherErrorRetry
(Error
e)
Method invoked when an error (other than a server or client timeout) is retried.
onReadTimeoutError
(ResponseError
e)
Method invoked when a read timeout error is obtained from the server.
onReadTimeoutRetry
(Error
e)
Method invoked when an execution is retried as a result of a read timeout from the server (coordinator to replica).
Method invoked when any response is obtained, the response can be the result of a successful execution or a server-side error.
onSpeculativeExecution
()Method invoked when a speculative execution is started.
Method invoked when a response is obtained successfully.
onUnavailableError
(ResponseError
e)
Method invoked when an unavailable error is obtained from the server.
onUnavailableRetry
(Error
e)
Method invoked when an execution is retried as a result of an unavailable error from the server.
onWriteTimeoutError
(ResponseError
e)
Method invoked when a write timeout error is obtained from the server.
onWriteTimeoutRetry
(Error
e)
Method invoked when an execution is retried as a result of a write timeout from the server (coordinator to replica).