GRPC C++  1.66.0
Public Member Functions
grpc::experimental::CallMetricRecorder Class Referenceabstract

Records call metrics for the purpose of load balancing. More...

#include <call_metric_recorder.h>

Public Member Functions

virtual ~CallMetricRecorder ()=default
 
virtual CallMetricRecorderRecordCpuUtilizationMetric (double value)=0
 Records a call metric measurement for CPU utilization. More...
 
virtual CallMetricRecorderRecordMemoryUtilizationMetric (double value)=0
 Records a call metric measurement for memory utilization. More...
 
virtual CallMetricRecorderRecordApplicationUtilizationMetric (double value)=0
 Records a call metric measurement for application specific utilization. More...
 
virtual CallMetricRecorderRecordQpsMetric (double value)=0
 Records a call metric measurement for queries per second. More...
 
virtual CallMetricRecorderRecordEpsMetric (double value)=0
 Records a call metric measurement for errors per second. More...
 
virtual CallMetricRecorderRecordUtilizationMetric (string_ref name, double value)=0
 Records a call metric measurement for utilization. More...
 
virtual CallMetricRecorderRecordRequestCostMetric (string_ref name, double value)=0
 Records a call metric measurement for request cost. More...
 
virtual CallMetricRecorderRecordNamedMetric (string_ref name, double value)=0
 Records an application-specific opaque metric measurement. More...
 

Detailed Description

Records call metrics for the purpose of load balancing.

During an RPC, call ServerContext::ExperimentalGetCallMetricRecorder() method to retrive the recorder for the current call.

Constructor & Destructor Documentation

◆ ~CallMetricRecorder()

virtual grpc::experimental::CallMetricRecorder::~CallMetricRecorder ( )
virtualdefault

Member Function Documentation

◆ RecordApplicationUtilizationMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordApplicationUtilizationMetric ( double  value)
pure virtual

Records a call metric measurement for application specific utilization.

Multiple calls to this method will override the stored value. Values may be larger than 1.0 when the usage exceeds the reporter dependent notion of soft limits. Values outside of the valid range [0, infy] are ignored.

◆ RecordCpuUtilizationMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordCpuUtilizationMetric ( double  value)
pure virtual

Records a call metric measurement for CPU utilization.

Multiple calls to this method will override the stored value. Values may be larger than 1.0 when the usage exceeds the reporter dependent notion of soft limits. Values outside of the valid range [0, infy] are ignored.

◆ RecordEpsMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordEpsMetric ( double  value)
pure virtual

Records a call metric measurement for errors per second.

Multiple calls to this method will override the stored value. Values outside of the valid range [0, infy) are ignored.

◆ RecordMemoryUtilizationMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordMemoryUtilizationMetric ( double  value)
pure virtual

Records a call metric measurement for memory utilization.

Multiple calls to this method will override the stored value. Values outside of the valid range [0, 1] are ignored.

◆ RecordNamedMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordNamedMetric ( string_ref  name,
double  value 
)
pure virtual

Records an application-specific opaque metric measurement.

Multiple calls to this method with the same name will override the corresponding stored value. The lifetime of the name string needs to be longer than the lifetime of the RPC itself, since it's going to be sent as trailers after the RPC finishes. It is assumed the strings are common names that are global constants.

◆ RecordQpsMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordQpsMetric ( double  value)
pure virtual

Records a call metric measurement for queries per second.

Multiple calls to this method will override the stored value. Values outside of the valid range [0, infy) are ignored.

◆ RecordRequestCostMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordRequestCostMetric ( string_ref  name,
double  value 
)
pure virtual

Records a call metric measurement for request cost.

Multiple calls to this method with the same name will override the corresponding stored value. The lifetime of the name string needs to be longer than the lifetime of the RPC itself, since it's going to be sent as trailers after the RPC finishes. It is assumed the strings are common names that are global constants.

◆ RecordUtilizationMetric()

virtual CallMetricRecorder& grpc::experimental::CallMetricRecorder::RecordUtilizationMetric ( string_ref  name,
double  value 
)
pure virtual

Records a call metric measurement for utilization.

Multiple calls to this method with the same name will override the corresponding stored value. The lifetime of the name string needs to be longer than the lifetime of the RPC itself, since it's going to be sent as trailers after the RPC finishes. It is assumed the strings are common names that are global constants. Values outside of the valid range [0, 1] are ignored.


The documentation for this class was generated from the following file: