GRPC C++  1.62.0
Public Member Functions | Static Public Member Functions | Friends
grpc::experimental::ServerMetricRecorder Class Reference

Records server wide metrics to be reported to the client. More...

#include <server_metric_recorder.h>

Public Member Functions

void SetCpuUtilization (double value)
 Records the server CPU utilization in the range [0, infy). More...
 
void SetMemoryUtilization (double value)
 Records the server memory utilization in the range [0, 1]. More...
 
void SetApplicationUtilization (double value)
 Records the application specific utilization in the range [0, infy]. More...
 
void SetQps (double value)
 Records number of queries per second to the server in the range [0, infy). More...
 
void SetEps (double value)
 Records number of errors per second to the server in the range [0, infy). More...
 
void SetNamedUtilization (string_ref name, double value)
 Records a named resource utilization value in the range [0, 1]. More...
 
void SetAllNamedUtilization (std::map< string_ref, double > named_utilization)
 Replaces all named resource utilization values. More...
 
void ClearCpuUtilization ()
 Clears the server CPU utilization if recorded. More...
 
void ClearMemoryUtilization ()
 Clears the server memory utilization if recorded. More...
 
void ClearApplicationUtilization ()
 Clears the application specific utilization if recorded. More...
 
void ClearQps ()
 Clears number of queries per second to the server if recorded. More...
 
void ClearEps ()
 Clears number of errors per second to the server if recorded. More...
 
void ClearNamedUtilization (string_ref name)
 Clears a named utilization value if exists. More...
 

Static Public Member Functions

static std::unique_ptr< ServerMetricRecorderCreate ()
 

Friends

class grpc::BackendMetricState
 
class OrcaService
 

Detailed Description

Records server wide metrics to be reported to the client.

Server implementation creates an instance and reports server metrics to it, and then passes it to ServerBuilder::experimental_type::EnableCallMetricRecording or experimental::OrcaService that read metrics to include in the report.

Member Function Documentation

◆ ClearApplicationUtilization()

void grpc::experimental::ServerMetricRecorder::ClearApplicationUtilization ( )

Clears the application specific utilization if recorded.

◆ ClearCpuUtilization()

void grpc::experimental::ServerMetricRecorder::ClearCpuUtilization ( )

Clears the server CPU utilization if recorded.

◆ ClearEps()

void grpc::experimental::ServerMetricRecorder::ClearEps ( )

Clears number of errors per second to the server if recorded.

◆ ClearMemoryUtilization()

void grpc::experimental::ServerMetricRecorder::ClearMemoryUtilization ( )

Clears the server memory utilization if recorded.

◆ ClearNamedUtilization()

void grpc::experimental::ServerMetricRecorder::ClearNamedUtilization ( string_ref  name)

Clears a named utilization value if exists.

◆ ClearQps()

void grpc::experimental::ServerMetricRecorder::ClearQps ( )

Clears number of queries per second to the server if recorded.

◆ Create()

static std::unique_ptr<ServerMetricRecorder> grpc::experimental::ServerMetricRecorder::Create ( )
static

◆ SetAllNamedUtilization()

void grpc::experimental::ServerMetricRecorder::SetAllNamedUtilization ( std::map< string_ref, double >  named_utilization)

Replaces all named resource utilization values.

No range validation. The name strings should remain valid while utilization values remain in this recorder. It is assumed that strings are common names that are global constants.

◆ SetApplicationUtilization()

void grpc::experimental::ServerMetricRecorder::SetApplicationUtilization ( double  value)

Records the application specific utilization in the range [0, infy].

Values outside of the valid range are rejected. Overrides the stored value when called again with a valid value.

◆ SetCpuUtilization()

void grpc::experimental::ServerMetricRecorder::SetCpuUtilization ( double  value)

Records the server CPU utilization in the range [0, infy).

Values may be larger than 1.0 when the usage exceeds the reporter dependent notion of soft limits. Values outside of the valid range are rejected. Overrides the stored value when called again with a valid value.

◆ SetEps()

void grpc::experimental::ServerMetricRecorder::SetEps ( double  value)

Records number of errors per second to the server in the range [0, infy).

Values outside of the valid range are rejected. Overrides the stored value when called again with a valid value.

◆ SetMemoryUtilization()

void grpc::experimental::ServerMetricRecorder::SetMemoryUtilization ( double  value)

Records the server memory utilization in the range [0, 1].

Values outside of the valid range are rejected. Overrides the stored value when called again with a valid value.

◆ SetNamedUtilization()

void grpc::experimental::ServerMetricRecorder::SetNamedUtilization ( string_ref  name,
double  value 
)

Records a named resource utilization value in the range [0, 1].

Values outside of the valid range are rejected. Overrides the stored value when called again with the same name. The name string should remain valid while this utilization remains in this recorder. It is assumed that strings are common names that are global constants.

◆ SetQps()

void grpc::experimental::ServerMetricRecorder::SetQps ( double  value)

Records number of queries per second to the server in the range [0, infy).

Values outside of the valid range are rejected. Overrides the stored value when called again with a valid value.

Friends And Related Function Documentation

◆ grpc::BackendMetricState

friend class grpc::BackendMetricState
friend

◆ OrcaService

friend class OrcaService
friend

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