Reviewer comments

reviewable/pr13883/r15
ncteisen 7 years ago
parent b93a006d64
commit 78e532a6e5
  1. 1
      src/core/ext/filters/client_channel/subchannel.cc
  2. 6
      src/core/lib/channel/channel_trace.cc
  3. 9
      src/core/lib/channel/channel_trace.h

@ -35,6 +35,7 @@
#include "src/core/ext/filters/client_channel/subchannel_index.h"
#include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gprpp/debug_location.h"

@ -152,10 +152,10 @@ char* fmt_time(gpr_timespec tm) {
for (int i = 7; i >= 1; i -= 3) {
if (ns_buffer[i] == '0' && ns_buffer[i + 1] == '0' &&
ns_buffer[i + 2] == '0') {
ns_buffer[i] = 0;
// Specially case in which all fractional digits were 0.
ns_buffer[i] = '\0';
// Edge case in which all fractional digits were 0.
if (i == 1) {
ns_buffer[0] = 0;
ns_buffer[0] = '\0';
}
} else {
break;

@ -48,15 +48,22 @@ class ChannelTrace : public RefCounted<ChannelTrace> {
};
// Adds a new trace event to the tracing object
//
// TODO(ncteisen): as this call is used more and more throughout the gRPC
// stack, determine if it makes more sense to accept a char* instead of a
// slice.
void AddTraceEvent(Severity severity, grpc_slice data);
// Adds a new trace event to the tracing object. This trace event refers to a
// an event on a child of the channel. For example, if this channel has
// created a new subchannel, then it would record that with a TraceEvent
// referencing the new subchannel.
//
// TODO(ncteisen): Once channelz is implemented, the events should reference
// the overall channelz object, not just the ChannelTrace object.
// TODO(ncteisen): as this call is used more and more throughout the gRPC
// stack, determine if it makes more sense to accept a char* instead of a
// slice.
void AddTraceEventReferencingChannel(
Severity severity, grpc_slice data,
RefCountedPtr<ChannelTrace> referenced_tracer);

Loading…
Cancel
Save