aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-19 15:19:43 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-19 15:19:43 -0700
commitb47214952bafad402b6854f20bb546d828bf5573 (patch)
treea524e6a54a60235f3ef837279879e258ce998490 /src
parent6104e4f33b4d2e735ae1c69df1a3fd5d57c931a4 (diff)
reviewer feedback
Diffstat (limited to 'src')
-rw-r--r--src/cpp/server/channelz/channelz_service_plugin.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/cpp/server/channelz/channelz_service_plugin.cc b/src/cpp/server/channelz/channelz_service_plugin.cc
index 8c2972915c..c1c41bb57c 100644
--- a/src/cpp/server/channelz/channelz_service_plugin.cc
+++ b/src/cpp/server/channelz/channelz_service_plugin.cc
@@ -29,6 +29,22 @@ namespace grpc {
namespace channelz {
namespace experimental {
+// This plugin is experimental for now. Track progress in
+// https://github.com/grpc/grpc/issues/15988.
+class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
+ public:
+ ChannelzServicePlugin();
+ ::grpc::string name() override;
+ void InitServer(::grpc::ServerInitializer* si) override;
+ void Finish(::grpc::ServerInitializer* si) override;
+ void ChangeArguments(const ::grpc::string& name, void* value) override;
+ bool has_async_methods() const override;
+ bool has_sync_methods() const override;
+
+ private:
+ std::shared_ptr<grpc::ChannelzService> channelz_service_;
+};
+
ChannelzServicePlugin::ChannelzServicePlugin()
: channelz_service_(new grpc::ChannelzService()) {}
@@ -70,14 +86,6 @@ void InitChannelzServiceBuilderPlugin() {
::grpc::ServerBuilder::InternalAddPluginFactory(&CreateChannelzServicePlugin);
}
-// Force InitChannelzServiceBuilderPlugin() to be called at static
-// initialization time.
-struct StaticChannelServicePluginInitializer {
- StaticChannelServicePluginInitializer() {
- InitChannelzServiceBuilderPlugin();
- }
-} static_channelz_service_plugin_initializer;
-
} // namespace experimental
} // namespace channelz
} // namespace grpc