Go to the documentation of this file.
19 #ifndef GRPCPP_EXT_SERVER_METRIC_RECORDER_H
20 #define GRPCPP_EXT_SERVER_METRIC_RECORDER_H
30 struct BackendMetricData;
34 class BackendMetricState;
36 namespace experimental {
45 static std::unique_ptr<ServerMetricRecorder>
Create();
98 struct BackendMetricDataState;
105 void UpdateBackendMetricDataState(
106 std::function<
void(grpc_core::BackendMetricData*)> updater);
108 grpc_core::BackendMetricData GetMetrics()
const;
111 std::shared_ptr<const BackendMetricDataState> GetMetricsIfChanged()
const;
114 std::shared_ptr<const BackendMetricDataState> metric_state_
115 ABSL_GUARDED_BY(mu_);
121 #endif // GRPCPP_EXT_SERVER_METRIC_RECORDER_H
This class is a non owning reference to a string.
Definition: string_ref.h:41
Records server wide metrics to be reported to the client.
Definition: server_metric_recorder.h:42
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
Definition: grpc_audit_logging.h:31
void SetCpuUtilization(double value)
Records the server CPU utilization in the range [0, infy).
static std::unique_ptr< ServerMetricRecorder > Create()
void SetAllNamedUtilization(std::map< string_ref, double > named_utilization)
Replaces all named resource utilization values.
friend class grpc::BackendMetricState
Definition: server_metric_recorder.h:95
void ClearNamedUtilization(string_ref name)
Clears a named utilization value if exists.
void ClearQps()
Clears number of queries per second to the server if recorded.
void SetMemoryUtilization(double value)
Records the server memory utilization in the range [0, 1].
void ClearApplicationUtilization()
Clears the application specific utilization if recorded.
void SetNamedUtilization(string_ref name, double value)
Records a named resource utilization value in the range [0, 1].
void ClearCpuUtilization()
Clears the server CPU utilization if recorded.
void SetApplicationUtilization(double value)
Records the application specific utilization in the range [0, infy].
void SetQps(double value)
Records number of queries per second to the server in the range [0, infy).
friend class OrcaService
Definition: server_metric_recorder.h:96
void SetEps(double value)
Records number of errors per second to the server in the range [0, infy).
void ClearEps()
Clears number of errors per second to the server if recorded.
void ClearMemoryUtilization()
Clears the server memory utilization if recorded.