Skip to content

Commit 9f5c6e5

Browse files
chore: generate libraries at Wed Apr 16 05:18:36 UTC 2025
1 parent a04494c commit 9f5c6e5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ public void testMetricsSingleUseQuery() {
216216
assertEquals(fakeServerTiming.get(), gfeLatencyValue, 0);
217217

218218
assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME));
219-
assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME));
219+
assertFalse(
220+
checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME));
220221
}
221222

222223
@Test
@@ -396,7 +397,8 @@ public void testNoServerTimingHeader() throws IOException, InterruptedException
396397
MetricData gfeConnectivityMetricData =
397398
getMetricData(metricReader, BuiltInMetricsConstant.GFE_CONNECTIVITY_ERROR_NAME);
398399
assertThat(getAggregatedValue(gfeConnectivityMetricData, expectedAttributes)).isEqualTo(1);
399-
assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME));
400+
assertFalse(
401+
checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME));
400402
spannerNoHeader.close();
401403
serverNoHeader.shutdown();
402404
serverNoHeader.awaitTermination();
@@ -439,8 +441,8 @@ private boolean checkIfMetricExists(InMemoryMetricReader reader, String metricNa
439441
String fullMetricName = BuiltInMetricsConstant.METER_NAME + "/" + metricName;
440442

441443
for (int attemptsLeft = 1000; attemptsLeft > 0; attemptsLeft--) {
442-
boolean exists = reader.collectAllMetrics().stream()
443-
.anyMatch(md -> md.getName().equals(fullMetricName));
444+
boolean exists =
445+
reader.collectAllMetrics().stream().anyMatch(md -> md.getName().equals(fullMetricName));
444446
if (exists) {
445447
return true;
446448
}
@@ -455,7 +457,6 @@ private boolean checkIfMetricExists(InMemoryMetricReader reader, String metricNa
455457
return false;
456458
}
457459

458-
459460
private long getAggregatedValue(MetricData metricData, Attributes attributes) {
460461
switch (metricData.getType()) {
461462
case HISTOGRAM:

0 commit comments

Comments
 (0)