Constructor
new OperationMetricsCollector(tabularApiSurface, methodName, streamingOperation, handlers)
Parameters:
| Name | Type | Description |
|---|---|---|
tabularApiSurface |
ITabularApiSurface |
Information about the Bigtable table being accessed. |
methodName |
MethodName |
The name of the method being traced. |
streamingOperation |
StreamingState |
Whether or not the call is a streaming operation. |
handlers |
Array.<IMetricsHandler> |
The metrics handlers used to store the record the metrics. |
Methods
onAttemptComplete(attemptStatus)
Called when an attempt (e.g., an RPC attempt) completes. Records attempt latencies.
Parameters:
| Name | Type | Description |
|---|---|---|
attemptStatus |
grpc.status |
The grpc status for the attempt. |
onAttemptStart()
Called when a new attempt starts. Records the start time of the attempt.
onMetadataReceived(metadata)
Called when metadata is received. Extracts server timing information if available.
Parameters:
| Name | Type | Description |
|---|---|---|
metadata |
object |
The received metadata. |
onOperationComplete(finalOperationStatus, applicationLatency)
Called when an operation completes (successfully or unsuccessfully). Records operation latencies, retry counts, and connectivity error counts.
Parameters:
| Name | Type | Description |
|---|---|---|
finalOperationStatus |
grpc.status |
Information about the completed operation. |
applicationLatency |
number |
The application latency measurement. |
onOperationStart()
Called when the operation starts. Records the start time.
onResponse()
Called when the first response is received. Records first response latencies.
onStatusMetadataReceived(status)
Called when status information is received. Extracts zone and cluster information.
Parameters:
| Name | Type | Description |
|---|---|---|
status |
object |
The received status information. |
wrapRequest(stream)
Called to add handlers to the stream so that we can observe header and trailer data for client side metrics.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |