Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Oct 7, 2024
1 parent 3734387 commit 969f197
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class BuiltinMetricsTracer extends BigtableTracer {
private final Attributes baseAttributes;

private Long serverLatencies = null;
private final AtomicLong grpcMessageSentDelay = new AtomicLong(0);

// OpenCensus (and server) histogram buckets use [start, end), however OpenTelemetry uses (start,
// end]. To work around this, we measure all the latencies in nanoseconds and convert them
Expand Down Expand Up @@ -264,7 +265,7 @@ public void batchRequestThrottled(long throttledTimeNanos) {

@Override
public void grpcMessageSent() {
totalClientBlockingTime.addAndGet(attemptTimer.elapsed(TimeUnit.NANOSECONDS));
grpcMessageSentDelay.set(attemptTimer.elapsed(TimeUnit.NANOSECONDS));
}

@Override
Expand Down Expand Up @@ -351,6 +352,7 @@ private void recordAttemptCompletion(@Nullable Throwable status) {
.put(STATUS_KEY, statusStr)
.build();

totalClientBlockingTime.addAndGet(grpcMessageSentDelay.get());
clientBlockingLatenciesHistogram.record(convertToMs(totalClientBlockingTime.get()), attributes);

attemptLatenciesHistogram.record(
Expand Down

0 comments on commit 969f197

Please sign in to comment.