Class CallMetricRecorder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CallMetricRecorderReturns the call metric recorder attached to the currentContext.recordApplicationUtilizationMetric(double value) Records a call metric measurement for application specific utilization in the range [0, inf).recordCallMetric(String name, double value) Deprecated.recordCpuUtilizationMetric(double value) Records a call metric measurement for CPU utilization in the range [0, inf).recordEpsMetric(double value) Records a call metric measurement for errors per second (eps) in the range [0, inf).recordMemoryUtilizationMetric(double value) Records a call metric measurement for memory utilization in the range [0, 1].recordNamedMetric(String name, double value) Records an application-specific opaque custom metric measurement.recordQpsMetric(double value) Records a call metric measurement for queries per second (qps) in the range [0, inf).recordRequestCostMetric(String name, double value) Records a call metric measurement for request cost.recordUtilizationMetric(String name, double value) Records a call metric measurement for utilization in the range [0, 1].
-
Constructor Details
-
CallMetricRecorder
public CallMetricRecorder()
-
-
Method Details
-
getCurrent
Returns the call metric recorder attached to the currentContext. If there is none, returns a no-op recorder.IMPORTANT:It returns the recorder specifically for the current RPC call. DO NOT save the returned object or share it between different RPC calls.
IMPORTANT:It must be called under the
Contextunder which the RPC handler was called. If it is called from a different thread, the Context must be propagated to the same thread, e.g., withContext.wrap(Runnable).- Since:
- 1.23.0
-
recordUtilizationMetric
Records a call metric measurement for utilization in the range [0, 1]. Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.23.0
-
recordCallMetric
@Deprecated @InlineMe(replacement="this.recordRequestCostMetric(name, value)") public CallMetricRecorder recordCallMetric(String name, double value) Deprecated.userecordRequestCostMetric(String, double)instead. This method will be removed in the future.Records a call metric measurement for request cost. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.47.0
-
recordRequestCostMetric
Records a call metric measurement for request cost. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.48.1
-
recordNamedMetric
Records an application-specific opaque custom metric measurement. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
-
recordCpuUtilizationMetric
Records a call metric measurement for CPU utilization in the range [0, inf). Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.47.0
-
recordApplicationUtilizationMetric
Records a call metric measurement for application specific utilization in the range [0, inf). Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
-
recordMemoryUtilizationMetric
Records a call metric measurement for memory utilization in the range [0, 1]. Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.47.0
-
recordQpsMetric
Records a call metric measurement for queries per second (qps) in the range [0, inf). Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
- Since:
- 1.54.0
-
recordEpsMetric
Records a call metric measurement for errors per second (eps) in the range [0, inf). Values outside the valid range are ignored. If RPC has already finished, this method is no-op.A latter record will overwrite its former name-sakes.
- Returns:
- this recorder object
-
recordRequestCostMetric(String, double)instead.