File tree Expand file tree Collapse file tree
src/test/java/com/google/cloud/bigtable/data/v2/it Expand file tree Collapse file tree Original file line number Diff line number Diff line change 190190 <difference >
191191 <differenceType >7004</differenceType >
192192 <className >com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker</className >
193+ <method >*</method >
193194 </difference >
194195 <difference >
195196 <differenceType >7012</differenceType >
Original file line number Diff line number Diff line change @@ -207,9 +207,9 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
207207 ProjectName name = ProjectName .of (testEnvRule .env ().getProjectId ());
208208
209209 // Interval is set in the monarch request when query metric timestamps.
210- // Restrict it to before we send to request and 1 minute after we send the request. If
210+ // Restrict it to before we send to request and 3 minute after we send the request. If
211211 // it turns out to be still flaky we can increase the filter range.
212- Instant end = Instant .now ().plus (Duration .ofMinutes (1 ));
212+ Instant end = Instant .now ().plus (Duration .ofMinutes (3 ));
213213 TimeInterval interval =
214214 TimeInterval .newBuilder ()
215215 .setStartTime (Timestamps .fromMillis (start .toEpochMilli ()))
@@ -271,9 +271,9 @@ public void testBuiltinMetricsWithCustomOTEL() throws Exception {
271271 Collection <MetricData > fromMetricReader = metricReader .collectAllMetrics ();
272272
273273 // Interval is set in the monarch request when query metric timestamps.
274- // Restrict it to before we send to request and 1 minute after we send the request. If
274+ // Restrict it to before we send to request and 3 minute after we send the request. If
275275 // it turns out to be still flaky we can increase the filter range.
276- Instant end = start .plus (Duration .ofMinutes (1 ));
276+ Instant end = start .plus (Duration .ofMinutes (3 ));
277277 TimeInterval interval =
278278 TimeInterval .newBuilder ()
279279 .setStartTime (Timestamps .fromMillis (start .toEpochMilli ()))
Original file line number Diff line number Diff line change 4242import java .util .UUID ;
4343import java .util .concurrent .ExecutionException ;
4444import java .util .concurrent .TimeUnit ;
45+ import java .util .logging .Logger ;
4546import java .util .stream .Collectors ;
4647import org .junit .After ;
4748import org .junit .Before ;
5152public class UnaryMetricsMetadataIT {
5253 @ ClassRule public static TestEnvRule testEnvRule = new TestEnvRule ();
5354
55+ private static final Logger LOGGER = Logger .getLogger (UnaryMetricsMetadataIT .class .getName ());
56+
5457 private BigtableDataClient client ;
5558 private InMemoryMetricReader metricReader ;
5659
@@ -147,14 +150,16 @@ public void testFailure() throws Exception {
147150 }
148151 }
149152
150- List <MetricData > metrics =
151- metricReader .collectAllMetrics ().stream ()
152- .filter (m -> m .getName ().contains (BuiltinMetricsConstants .OPERATION_LATENCIES_NAME ))
153- .collect (Collectors .toList ());
153+ MetricData metricData = null ;
154+ for (MetricData md : metricReader .collectAllMetrics ()) {
155+ if (md .getName ().contains (BuiltinMetricsConstants .OPERATION_LATENCIES_NAME )) {
156+ metricData = md ;
157+ break ;
158+ }
159+ }
154160
155- assertThat (metrics . size ()). isEqualTo ( 1 );
161+ assertThat (metricData ). isNotNull ( );
156162
157- MetricData metricData = metrics .get (0 );
158163 List <PointData > pointData = new ArrayList <>(metricData .getData ().getPoints ());
159164 List <String > clusterAttributes =
160165 pointData .stream ()
You can’t perform that action at this time.
0 commit comments