reviewer feedback:

reviewable/pr15343/r8
ncteisen 7 years ago
parent 70f7558a18
commit 7e7edc95b3
  1. 7
      src/core/lib/surface/call.cc
  2. 2
      src/core/lib/surface/channel.cc
  3. 2
      src/core/lib/surface/channel.h
  4. 4
      test/core/end2end/tests/simple_request.cc

@ -479,7 +479,7 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
}
grpc_core::channelz::Channel* channelz_channel =
grpc_channel_get_channelz_channel_node(call->channel);
grpc_channel_get_channelz_node(call->channel);
channelz_channel->RecordCallStarted();
grpc_slice_unref_internal(path);
@ -525,7 +525,6 @@ static void release_call(void* call, grpc_error* error) {
GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
}
static void set_status_value_directly(grpc_status_code status, void* dest);
static void destroy_call(void* call, grpc_error* error) {
GPR_TIMER_SCOPE("destroy_call", 0);
size_t i;
@ -1261,15 +1260,13 @@ static void post_batch_completion(batch_control* bctl) {
call->final_op.server.cancelled, nullptr, nullptr);
}
if (call->channel != nullptr) {
grpc_core::channelz::Channel* channelz_channel =
grpc_channel_get_channelz_channel_node(call->channel);
grpc_channel_get_channelz_node(call->channel);
if (*call->final_op.client.status != GRPC_STATUS_OK) {
channelz_channel->RecordCallFailed();
} else {
channelz_channel->RecordCallSucceeded();
}
}
GRPC_ERROR_UNREF(error);
error = GRPC_ERROR_NONE;

@ -190,7 +190,7 @@ char* grpc_channel_render_channelz(grpc_channel* channel) {
return channel->channelz_channel->RenderJSON();
}
grpc_core::channelz::Channel* grpc_channel_get_channelz_channel_node(
grpc_core::channelz::Channel* grpc_channel_get_channelz_node(
grpc_channel* channel) {
return channel->channelz_channel.get();
}

@ -51,7 +51,7 @@ grpc_call* grpc_channel_create_pollset_set_call(
/** Get a (borrowed) pointer to this channels underlying channel stack */
grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel);
grpc_core::channelz::Channel* grpc_channel_get_channelz_channel_node(
grpc_core::channelz::Channel* grpc_channel_get_channelz_node(
grpc_channel* channel);
/** Get a grpc_mdelem of grpc-status: X where X is the numeric value of

@ -259,7 +259,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) {
// ensures that core properly tracked the one call that occurred in this
// simple end2end test.
grpc_core::channelz::Channel* channelz_channel =
grpc_channel_get_channelz_channel_node(f.client);
grpc_channel_get_channelz_node(f.client);
char* json = channelz_channel->RenderJSON();
GPR_ASSERT(nullptr != strstr(json, "\"callsStarted\":\"1\""));
GPR_ASSERT(nullptr != strstr(json, "\"callsFailed\":\"1\""));
@ -282,7 +282,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
// The following is a quick sanity check on channelz functionality. It
// ensures that core properly tracked the ten calls that occurred.
grpc_core::channelz::Channel* channelz_channel =
grpc_channel_get_channelz_channel_node(f.client);
grpc_channel_get_channelz_node(f.client);
char* json = channelz_channel->RenderJSON();
GPR_ASSERT(nullptr != strstr(json, "\"callsStarted\":\"10\""));
GPR_ASSERT(nullptr != strstr(json, "\"callsFailed\":\"10\""));

Loading…
Cancel
Save