arne-alex commented on code in PR #23333:
URL: https://github.com/apache/beam/pull/23333#discussion_r995467528


##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorkerTest.java:
##########
@@ -3081,6 +3089,222 @@ public void testActiveWorkRefresh() throws Exception {
     assertThat(server.numGetDataRequests(), greaterThan(0));
   }
 
+  // A class that aggregates LatencyAttribution data from active work refresh 
requests.
+  private static class ActiveWorkRefreshSink {
+    Map<Long, EnumMap<LatencyAttribution.State, Duration>> totalDurations = 
new HashMap<>();
+
+    // Accessor for reading out aggregated LatencyAttribution data.
+    Duration getLatencyAttributionDuration(long workToken, 
LatencyAttribution.State state) {
+      EnumMap<LatencyAttribution.State, Duration> durations = 
totalDurations.get(workToken);
+      if (durations == null) {
+        return Duration.ZERO;
+      }
+      Duration d = durations.get(state);

Review Comment:
   Done (after next force push)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to