Reviewer comments

reviewable/pr26673/r7
Yash Tibrewal 4 years ago
parent f3b5865a57
commit 66f1d16d7d
  1. 10
      src/core/lib/channel/call_tracer.h
  2. 2
      src/cpp/ext/filters/census/open_census_call_tracer.h

@ -51,6 +51,8 @@ class CallTracer {
virtual void RecordSendTrailingMetadata(
grpc_metadata_batch* send_trailing_metadata) = 0;
virtual void RecordSendMessage(const ByteStream& send_message) = 0;
// The `RecordReceivedxx()` methods should only be invoked when the
// metadata/message was successfully received, i.e., without any error.
// TODO(yashkt): We are using gpr_atm here instead of absl::string_view
// since that's what the transport API uses, and performing an atomic load
// is unnecessary if the census tracer does not need it at present. Fix this
@ -62,9 +64,6 @@ class CallTracer {
virtual void RecordReceivedTrailingMetadata(
grpc_metadata_batch* recv_trailing_metadata) = 0;
virtual void RecordCancel(grpc_error_handle cancel_error) = 0;
// Records annotations if supported by the attached tracer library, no-op
// otherwise.
virtual void RecordAnnotation(absl::string_view annotation) = 0;
// Should be the last API call to the object. Once invoked, the tracer
// library is free to destroy the object.
virtual void RecordEnd(const grpc_call_final_info& final_info) = 0;
@ -74,15 +73,12 @@ class CallTracer {
// Records a new attempt for the associated call. \a transparent denotes
// whether the attempt is being made as a transparent retry or as a
// non-transparent retry/heding attempt. (There will be atleast one attempt
// non-transparent retry/heding attempt. (There will be at least one attempt
// even if the call is not being retried.) The `CallTracer` object retains
// ownership to the newly created `CallAttemptTracer` object. RecordEnd()
// serves as an indication that the call stack is done with all API calls, and
// the tracer library is free to destroy it after that.
virtual CallAttemptTracer* StartNewAttempt(bool is_transparent_retry) = 0;
// Records annotations if supported by the attached tracer library, no-op
// otherwise.
virtual void RecordAnnotation(absl::string_view annotation) = 0;
};
} // namespace grpc_core

@ -46,7 +46,6 @@ class OpenCensusCallTracer : public grpc_core::CallTracer {
void RecordReceivedTrailingMetadata(
grpc_metadata_batch* /* recv_trailing_metadata */) override {}
void RecordCancel(grpc_error_handle /* cancel_error */) override {}
void RecordAnnotation(absl::string_view /* annotation */) override {}
void RecordEnd(const grpc_call_final_info& /* final_info */) override {}
CensusContext* context() { return &context_; }
@ -59,7 +58,6 @@ class OpenCensusCallTracer : public grpc_core::CallTracer {
bool /* is_transparent_retry */) override {
return nullptr;
}
void RecordAnnotation(absl::string_view /* annotation */) override {}
CensusContext* context() { return &context_; }

Loading…
Cancel
Save