aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-01-24 16:59:32 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2018-01-24 16:59:32 -0800
commit804507d638f3bd0b2bcec1fcb2fd1cdbc361a90b (patch)
treee9e215e79c60cbdf458849dbcaff4eea56e6f988
parent0a538e6dcf20fd392fc51a4e187ebf1e44c5a8c8 (diff)
Add get_uuid method to channel
-rw-r--r--src/core/lib/surface/channel.cc4
-rw-r--r--src/core/lib/surface/channel.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index 2c40880579..b78a218b1c 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -217,6 +217,10 @@ char* grpc_channel_get_trace(grpc_channel* channel, bool recursive) {
return channel->tracer->RenderTrace(recursive);
}
+intptr_t grpc_channel_get_uuid(grpc_channel* channel) {
+ return channel->tracer->GetUuid();
+}
+
grpc_channel* grpc_channel_create(const char* target,
const grpc_channel_args* input_args,
grpc_channel_stack_type channel_stack_type,
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 5820bbbd80..12a806ecd7 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -58,8 +58,14 @@ grpc_mdelem grpc_channel_get_reffed_status_elem(grpc_channel* channel,
size_t grpc_channel_get_call_size_estimate(grpc_channel* channel);
void grpc_channel_update_call_size_estimate(grpc_channel* channel, size_t size);
+// Returns the JSON formatted channel trace for this channel. If recursive
+// is true, it will render all of the trace for this channel's subchannels.
char* grpc_channel_get_trace(grpc_channel* channel, bool recursive);
+// Returns the channel uuid, which can be used to look up its trace at a
+// later time.
+intptr_t grpc_channel_get_uuid(grpc_channel* channel);
+
#ifndef NDEBUG
void grpc_channel_internal_ref(grpc_channel* channel, const char* reason);
void grpc_channel_internal_unref(grpc_channel* channel, const char* reason);