call_metric_recorder.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2022 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPCPP_EXT_CALL_METRIC_RECORDER_H
20 #define GRPCPP_EXT_CALL_METRIC_RECORDER_H
21 
22 #include <memory>
23 #include <string>
24 
25 #include "absl/strings/string_view.h"
26 #include "absl/types/optional.h"
27 
30 
31 namespace grpc_core {
32 class Arena;
33 struct BackendMetricData;
34 } // namespace grpc_core
35 
36 namespace grpc {
37 class ServerBuilder;
38 
39 namespace experimental {
40 class OrcaServerInterceptor;
41 
42 // Registers the per-rpc orca load reporter into the \a ServerBuilder.
43 // Once this is done, the server will automatically send the load metrics
44 // after each RPC as they were reported. In order to report load metrics,
45 // call the \a ServerContext::ExperimentalGetCallMetricRecorder() method to
46 // retrieve the recorder for the current call.
47 void EnableCallMetricRecording(ServerBuilder*);
48 
53  public:
56 
60 
64 
73 
82 
83  private:
85 
89 };
90 
91 } // namespace experimental
92 } // namespace grpc
93 
94 #endif // GRPCPP_EXT_CALL_METRIC_RECORDER_H
grpc::string_ref
Definition: grpcpp/impl/codegen/string_ref.h:43
grpc::experimental::CallMetricRecorder::RecordRequestCostMetric
CallMetricRecorder & RecordRequestCostMetric(string_ref name, double value)
Definition: call_metric_recorder.cc:69
grpc::internal::Mutex
Definition: include/grpcpp/impl/codegen/sync.h:59
grpc
Definition: grpcpp/alarm.h:33
grpc_core::BackendMetricData
Definition: backend_metric_data.h:31
grpc_core
Definition: call_metric_recorder.h:31
slice.h
ABSL_GUARDED_BY
#define ABSL_GUARDED_BY(x)
Definition: abseil-cpp/absl/base/thread_annotations.h:62
setup.name
name
Definition: setup.py:542
grpc_core::Arena
Definition: src/core/lib/resource_quota/arena.h:45
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
grpc::experimental::CallMetricRecorder::mu_
internal::Mutex mu_
Definition: call_metric_recorder.h:86
sync.h
grpc::experimental::OrcaServerInterceptor
Definition: orca_interceptor.h:30
absl::optional< std::string >
grpc::experimental::CallMetricRecorder::RecordCpuUtilizationMetric
CallMetricRecorder & RecordCpuUtilizationMetric(double value)
Definition: call_metric_recorder.cc:47
grpc::experimental::CallMetricRecorder::~CallMetricRecorder
~CallMetricRecorder()
Definition: call_metric_recorder.cc:43
grpc::experimental::CallMetricRecorder
Definition: call_metric_recorder.h:52
grpc::experimental::CallMetricRecorder::RecordUtilizationMetric
CallMetricRecorder & RecordUtilizationMetric(string_ref name, double value)
Definition: call_metric_recorder.cc:61
value
const char * value
Definition: hpack_parser_table.cc:165
grpc::experimental::CallMetricRecorder::CallMetricRecorder
CallMetricRecorder(grpc_core::Arena *arena)
Definition: call_metric_recorder.cc:40
grpc::experimental::EnableCallMetricRecording
void EnableCallMetricRecording(ServerBuilder *)
Definition: orca_interceptor.cc:74
grpc::experimental::CallMetricRecorder::RecordMemoryUtilizationMetric
CallMetricRecorder & RecordMemoryUtilizationMetric(double value)
Definition: call_metric_recorder.cc:54
backend_metric_data_
BackendMetricData backend_metric_data_
Definition: oob_backend_metric.cc:278
grpc::experimental::CallMetricRecorder::CreateSerializedReport
absl::optional< std::string > CreateSerializedReport()
Definition: call_metric_recorder.cc:77


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:51