diff options
author | 2018-08-03 11:24:18 -0400 | |
---|---|---|
committer | 2018-08-03 11:24:18 -0400 | |
commit | 0db2b830eb95c12975cb69b945f837194f38d96c (patch) | |
tree | 2886d6fd66ed79a4371d92c4fd12408ccb665b12 /src/core/lib/channel/channelz.cc | |
parent | fde951db9c6f87597faa7ae1b3d0f521ff1adb51 (diff) |
Refactor rendering to use template method pattern
Diffstat (limited to 'src/core/lib/channel/channelz.cc')
-rw-r--r-- | src/core/lib/channel/channelz.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc index 1ac7bd3976..9f54850002 100644 --- a/src/core/lib/channel/channelz.cc +++ b/src/core/lib/channel/channelz.cc @@ -117,6 +117,9 @@ grpc_json* ChannelNode::RenderJson() { GRPC_JSON_OBJECT, false); json = data; json_iterator = nullptr; + // template method. Child classes may override this to add their specific + // functionality. + PopulateConnectivityState(json); // populate the target. GPR_ASSERT(target_.get() != nullptr); grpc_json_create_child(nullptr, json, "target", target_.get(), @@ -129,6 +132,10 @@ grpc_json* ChannelNode::RenderJson() { } // ask CallCountingHelper to populate trace and call count data. call_counter_.PopulateCallCounts(json); + json = top_level_json; + // template method. Child classes may override this to add their specific + // functionality. + PopulateChildRefs(json); return top_level_json; } |