Skip to content

Commit

Permalink
remove unary application latency streaming tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed May 24, 2022
1 parent d61ccfd commit 8a2aa0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ private void recordOperationCompletion(@Nullable Throwable status) {
applicationLatencyTimer.stop();
totalApplicationLatency.addAndGet(applicationLatencyTimer.elapsed(TimeUnit.MILLISECONDS));
}
recorder.recordApplicationLatency(totalApplicationLatency.get(), tableId, zone, cluster);

recorder.recordOperationLatencies(operationTimer.elapsed(TimeUnit.MILLISECONDS));

if (operationType == ApiTracerFactory.OperationType.ServerStreaming
&& spanName.getMethodName().equals("ReadRows")) {
recorder.recordFirstResponseLatency(firstResponsePerOpTimer.elapsed(TimeUnit.MILLISECONDS));
recorder.recordApplicationLatency(totalApplicationLatency.get(), tableId, zone, cluster);
}

recorder.recordOperationLevelWithoutStreaming(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,6 @@ public void onComplete() {
assertThat(longValue.getValue()).isLessThan(applicationLatency * (counter.get() + 1));
}

@Test
public void testMutateRowApplicationLatency() {
// Unary callable application latency is the delay between retries
stub.mutateRowCallable()
.call(RowMutation.create(TABLE_ID, "random-row").setCell("cf", "q", "value"));

verify(builtinMetricsRecorder)
.recordApplicationLatency(
longValue.capture(), tableId.capture(), zone.capture(), cluster.capture());

// Application latency should be slightly less than the total delay between 2 requests observed
// from the server side. To make
// the test less flaky comparing with half of the server side delay here.
assertThat(longValue.getValue()).isAtLeast(serverTotalRetryDelay.get() / 2);
assertThat(longValue.getValue()).isAtMost(serverTotalRetryDelay.get());
}

@Test
public void testRetryCount() {
stub.mutateRowCallable()
Expand Down

0 comments on commit 8a2aa0e

Please sign in to comment.