aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/client_channel_channelz.h
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-20 14:26:04 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-20 14:26:04 -0700
commit8cb2d0c64afd9c766ea6b4c41f3125879091d08a (patch)
tree4b1124a4bdcb40612c78612e39f729610a02ee09 /src/core/ext/filters/client_channel/client_channel_channelz.h
parentca32a8a85286ae0c9c94c3eaeaee3100d0304f99 (diff)
Restructure everything
Diffstat (limited to 'src/core/ext/filters/client_channel/client_channel_channelz.h')
-rw-r--r--src/core/ext/filters/client_channel/client_channel_channelz.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.h b/src/core/ext/filters/client_channel/client_channel_channelz.h
index b1bd8db89e..73eea7cecf 100644
--- a/src/core/ext/filters/client_channel/client_channel_channelz.h
+++ b/src/core/ext/filters/client_channel/client_channel_channelz.h
@@ -45,12 +45,7 @@ class ClientChannelNode : public ChannelNode {
grpc_channel* channel, size_t channel_tracer_max_nodes,
bool is_top_level_channel);
- // Override this functionality since client_channels have a notion of
- // channel connectivity.
- void PopulateConnectivityState(grpc_json* json) override;
-
- // Override this functionality since client_channels have subchannels
- void PopulateChildRefs(grpc_json* json) override;
+ grpc_json* RenderJson() override;
// Helper to create a channel arg to ensure this type of ChannelNode is
// created.
@@ -65,35 +60,35 @@ class ClientChannelNode : public ChannelNode {
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_NEW
grpc_channel_element* client_channel_;
+
+ // helpers
+ void PopulateConnectivityState(grpc_json* json);
+ void PopulateChildRefs(grpc_json* json);
};
-// Subtype of SubchannelNode that overrides and provides client_channel
-// specific functionality like querying for connectivity_state and
-// subchannel target.
-class ClientChannelSubchannelNode : public SubchannelNode {
+// Handles channelz bookkeeping for sockets
+class SubchannelNode : public CallCountingAndTracingNode {
public:
- ClientChannelSubchannelNode(size_t channel_tracer_max_nodes,
- grpc_subchannel* subchannel);
- ~ClientChannelSubchannelNode() override {}
-
- // Override this functionality since subchannels have a notion of
- // channel connectivity.
- void PopulateConnectivityState(grpc_json* json) override;
-
- // Override this functionality since client_channels subchannels hold
- // their own target.
- void PopulateTarget(grpc_json* json) override;
+ SubchannelNode(grpc_subchannel* subchannel, size_t channel_tracer_max_nodes);
+ ~SubchannelNode() override;
void MarkSubchannelDestroyed() {
GPR_ASSERT(subchannel_ != nullptr);
subchannel_ = nullptr;
}
+ grpc_json* RenderJson() override;
+
+ intptr_t subchannel_uuid() { return subchannel_uuid_; }
+
private:
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_NEW
+ intptr_t subchannel_uuid_;
grpc_subchannel* subchannel_;
UniquePtr<char> target_;
+
+ void PopulateConnectivityState(grpc_json* json);
};
} // namespace channelz