GRPC C++
1.66.0
|
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< ServerMetricRecorder > | Create () |
Friends | |
class | grpc::BackendMetricState |
class | OrcaService |
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.
void grpc::experimental::ServerMetricRecorder::ClearApplicationUtilization | ( | ) |
Clears the application specific utilization if recorded.
void grpc::experimental::ServerMetricRecorder::ClearCpuUtilization | ( | ) |
Clears the server CPU utilization if recorded.
void grpc::experimental::ServerMetricRecorder::ClearEps | ( | ) |
Clears number of errors per second to the server if recorded.
void grpc::experimental::ServerMetricRecorder::ClearMemoryUtilization | ( | ) |
Clears the server memory utilization if recorded.
void grpc::experimental::ServerMetricRecorder::ClearNamedUtilization | ( | string_ref | name | ) |
Clears a named utilization value if exists.
void grpc::experimental::ServerMetricRecorder::ClearQps | ( | ) |
Clears number of queries per second to the server if recorded.
|
static |
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.
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.
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.
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.
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.
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.
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.
|
friend |
|
friend |