aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel/channelz.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/channel/channelz.h')
-rw-r--r--src/core/lib/channel/channelz.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
index 14edc75123..e2cef233e6 100644
--- a/src/core/lib/channel/channelz.h
+++ b/src/core/lib/channel/channelz.h
@@ -124,6 +124,18 @@ class ChannelNode : public BaseNode {
grpc_json* RenderJson() override;
+ // template methods. RenderJSON uses these methods to render its JSON
+ // representation. These are virtual so that children classes may provide
+ // their specific mechanism for populating these parts of the channelz
+ // object.
+ //
+ // ChannelNode does not have a notion of connectivity state or child refs,
+ // so it leaves these implementations blank.
+ //
+ // This is utilizing the template method design pattern.
+ virtual void PopulateConnectivityState(grpc_json* json) {}
+ virtual void PopulateChildRefs(grpc_json* json) {}
+
void MarkChannelDestroyed() {
GPR_ASSERT(channel_ != nullptr);
channel_ = nullptr;
@@ -144,14 +156,6 @@ class ChannelNode : public BaseNode {
void RecordCallFailed() { call_counter_.RecordCallFailed(); }
void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
- protected:
- // provides view of target for child.
- char* target_view() { return target_.get(); }
- // provides access to call_counter_ for child.
- CallCountingHelper* call_counter() { return &call_counter_; }
- // provides access to channel trace for child.
- ChannelTrace* trace() { return &trace_; }
-
private:
// to allow the channel trace test to access trace();
friend class testing::ChannelNodePeer;