aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/client_channel_channelz.cc
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-09-27 09:45:59 -0500
committerGravatar ncteisen <ncteisen@gmail.com>2018-09-27 09:45:59 -0500
commit4cc16f951c0909196a9ed62774adcbbaf9cc88c1 (patch)
tree6ce70223a7ba7af7bdc449381a27b534ae5705e3 /src/core/ext/filters/client_channel/client_channel_channelz.cc
parentf13a74312672aaf7c72e984f59dbd351dcda4e8a (diff)
Simplifiy transport querying function
Diffstat (limited to 'src/core/ext/filters/client_channel/client_channel_channelz.cc')
-rw-r--r--src/core/ext/filters/client_channel/client_channel_channelz.cc29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.cc b/src/core/ext/filters/client_channel/client_channel_channelz.cc
index 4fedcbcbb6..8d02304d19 100644
--- a/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -136,23 +136,6 @@ void SubchannelNode::PopulateConnectivityState(grpc_json* json) {
false);
}
-void SubchannelNode::PopulateChildSockets(grpc_json* json) {
- ChildRefsList child_sockets;
- grpc_json* json_iterator = nullptr;
- grpc_subchannel_populate_child_sockets(subchannel_, &child_sockets);
- if (!child_sockets.empty()) {
- grpc_json* array_parent = grpc_json_create_child(
- nullptr, json, "socketRef", nullptr, GRPC_JSON_ARRAY, false);
- for (size_t i = 0; i < child_sockets.size(); ++i) {
- json_iterator =
- grpc_json_create_child(json_iterator, array_parent, nullptr, nullptr,
- GRPC_JSON_OBJECT, false);
- grpc_json_add_number_string_child(json_iterator, nullptr, "socketId",
- child_sockets[i]);
- }
- }
-}
-
grpc_json* SubchannelNode::RenderJson() {
grpc_json* top_level_json = grpc_json_create(GRPC_JSON_OBJECT);
grpc_json* json = top_level_json;
@@ -184,7 +167,17 @@ grpc_json* SubchannelNode::RenderJson() {
// ask CallCountingHelper to populate trace and call count data.
call_counter_.PopulateCallCounts(json);
json = top_level_json;
- PopulateChildSockets(json);
+ // populate the child socket.
+ intptr_t socket_uuid = grpc_subchannel_get_child_socket_uuid(subchannel_);
+ if (socket_uuid != 0) {
+ grpc_json* array_parent = grpc_json_create_child(
+ nullptr, json, "socketRef", nullptr, GRPC_JSON_ARRAY, false);
+ json_iterator =
+ grpc_json_create_child(json_iterator, array_parent, nullptr, nullptr,
+ GRPC_JSON_OBJECT, false);
+ grpc_json_add_number_string_child(json_iterator, nullptr, "socketId",
+ socket_uuid);
+ }
return top_level_json;
}