Skip to content

Commit b46dd45

Browse files
committed
chore: enable afe latency metric test
1 parent 3d585cf commit b46dd45

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import com.google.cloud.spanner.*;
2525
import com.google.cloud.spanner.testing.EmulatorSpannerHelper;
2626
import com.google.common.base.Stopwatch;
27-
import com.google.common.base.Strings;
28-
import com.google.common.truth.IntegerSubject;
2927
import com.google.monitoring.v3.ListTimeSeriesRequest;
3028
import com.google.monitoring.v3.ListTimeSeriesResponse;
3129
import com.google.monitoring.v3.ProjectName;
@@ -130,29 +128,9 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
130128
response = metricClient.listTimeSeriesCallable().call(request);
131129
}
132130

133-
// afe_latencies metric currently does not return data as afe server-timing header is
134-
// disabled.
135-
// Keeping this check to enable this check in the future.
136-
if (metric.equals("afe_latencies")) {
137-
IntegerSubject subject =
138-
assertWithMessage("Metric " + metric + " returned data.")
139-
.that(response.getTimeSeriesCount());
140-
if (isAfeMetricEnabled()) {
141-
subject.isGreaterThan(0);
142-
} else {
143-
subject.isEqualTo(0);
144-
}
145-
146-
} else {
147-
assertWithMessage("Metric " + metric + " didn't return any data.")
148-
.that(response.getTimeSeriesCount())
149-
.isGreaterThan(0);
150-
}
131+
assertWithMessage("Metric " + metric + " didn't return any data.")
132+
.that(response.getTimeSeriesCount())
133+
.isGreaterThan(0);
151134
}
152135
}
153-
154-
private boolean isAfeMetricEnabled() {
155-
String jobType = System.getenv("JOB_TYPE");
156-
return !Strings.isNullOrEmpty(jobType) && jobType.contains("devel");
157-
}
158136
}

0 commit comments

Comments
 (0)