server_load_reporting.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 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_SERVER_LOAD_REPORTING_H
20 #define GRPCPP_EXT_SERVER_LOAD_REPORTING_H
21 
23 
24 #include <grpc/load_reporting.h>
28 
29 namespace grpc {
30 namespace load_reporter {
31 namespace experimental {
32 
33 // The ServerBuilderOption to enable server-side load reporting feature. To
34 // enable the feature, please make sure the binary builds with the
35 // grpcpp_server_load_reporting library and set this option in the
36 // ServerBuilder.
38  : public grpc::ServerBuilderOption {
39  public:
41  void UpdatePlugins(std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>>*
42  plugins) override;
43 };
44 
45 // Adds the load reporting cost with \a cost_name and \a cost_value in the
46 // trailing metadata of the server context.
48  const std::string& cost_name, double cost_value);
49 
50 } // namespace experimental
51 } // namespace load_reporter
52 } // namespace grpc
53 
54 #endif // GRPCPP_EXT_SERVER_LOAD_REPORTING_H
load_reporting.h
grpc::ServerContext
Definition: grpcpp/impl/codegen/server_context.h:566
ctx
Definition: benchmark-async.c:30
grpc::load_reporter::experimental::LoadReportingServiceServerBuilderOption::UpdatePlugins
void UpdatePlugins(std::vector< std::unique_ptr< grpc::ServerBuilderPlugin >> *plugins) override
Alter the ServerBuilderPlugin map that will be added into ServerBuilder.
Definition: load_reporting_service_server_builder_option.cc:41
grpc::load_reporter::experimental::AddLoadReportingCost
void AddLoadReportingCost(grpc::ServerContext *ctx, const std::string &cost_name, double cost_value)
Definition: src/cpp/server/load_reporter/util.cc:36
grpc
Definition: grpcpp/alarm.h:33
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::load_reporter::experimental::LoadReportingServiceServerBuilderOption
Definition: server_load_reporting.h:37
config.h
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc::load_reporter::experimental::LoadReportingServiceServerBuilderOption::UpdateArguments
void UpdateArguments(grpc::ChannelArguments *args) override
Alter the ChannelArguments used to create the gRPC server.
Definition: load_reporting_service_server_builder_option.cc:36
grpc::ServerBuilderOption
Interface to pass an option to a ServerBuilder.
Definition: grpcpp/impl/server_builder_option.h:31
server_builder_option.h
grpc::ChannelArguments
Definition: grpcpp/support/channel_arguments.h:39
server_context.h
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:17