diff options
author | ncteisen <ncteisen@gmail.com> | 2018-07-29 20:43:05 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2018-07-29 20:46:22 -0700 |
commit | 844d4efcd2325504c6d916f7ad3b3cc638fada70 (patch) | |
tree | 9ba6a6b20760627470c45b36e8c9cda280651332 /src/core/ext/filters | |
parent | 58db94e5d9f3e55f14760f936a42e5e6ddb6bd5b (diff) | |
download | grpc-grpc-844d4efcd2325504c6d916f7ad3b3cc638fada70.tar.gz |
Count calls for subchannels
Diffstat (limited to 'src/core/ext/filters')
-rw-r--r-- | src/core/ext/filters/client_channel/client_channel.cc | 22 | ||||
-rw-r--r-- | src/core/ext/filters/client_channel/subchannel.cc | 3 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 683cb0e01d..0368590a6a 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -1154,16 +1154,6 @@ static void pending_batches_add(grpc_call_element* elem, grpc_connected_subchannel_call_get_parent_data( calld->subchannel_call)); retry_commit(elem, retry_state); - // If we are not going to retry and have not yet started, pretend - // retries are disabled so that we don't bother with retry overhead. - if (calld->num_attempts_completed == 0) { - if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: disabling retries before first attempt", - chand, calld); - } - calld->enable_retries = false; - } } } } @@ -1942,6 +1932,12 @@ static void recv_trailing_metadata_ready(void* arg, grpc_error* error) { grpc_mdelem* server_pushback_md = nullptr; get_call_status(batch_data, GRPC_ERROR_REF(error), &status, &server_pushback_md); + if (status == GRPC_STATUS_OK) { + calld->pick.connected_subchannel->channelz_subchannel() + ->RecordCallSucceeded(); + } else { + calld->pick.connected_subchannel->channelz_subchannel()->RecordCallFailed(); + } if (grpc_client_channel_trace.enabled()) { gpr_log(GPR_INFO, "chand=%p calld=%p: call finished, status=%s", chand, calld, grpc_status_code_to_string(status)); @@ -2797,12 +2793,6 @@ static void apply_service_config_to_call_locked(grpc_call_element* elem) { } } } - // If no retry policy, disable retries. - // TODO(roth): Remove this when adding support for transparent retries. - if (calld->method_params == nullptr || - calld->method_params->retry_policy() == nullptr) { - calld->enable_retries = false; - } } // Invoked once resolver results are available. diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index f0f8d94ef4..b74a354e9e 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -865,6 +865,9 @@ grpc_error* ConnectedSubchannel::CreateCall(const CallArgs& args, gpr_log(GPR_ERROR, "error: %s", error_string); return error; } + if (channelz_subchannel_ != nullptr) { + channelz_subchannel_->RecordCallStarted(); + } grpc_call_stack_set_pollset_or_pollset_set(callstk, args.pollent); return GRPC_ERROR_NONE; } |