diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 807ab7ae436..65071672f27 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.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,14 +1260,12 @@ 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); - if (*call->final_op.client.status != GRPC_STATUS_OK) { - channelz_channel->RecordCallFailed(); - } else { - channelz_channel->RecordCallSucceeded(); - } + grpc_core::channelz::Channel* channelz_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); diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index c95af0f2bdf..d2b52dad2fd 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -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(); } diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index bfeec9ec9be..6d2e1931e68 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -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 diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index d24f7bc6206..16fa4906085 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -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\""));