You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "lukecwik (via GitHub)" <gi...@apache.org> on 2023/02/03 21:23:13 UTC

[GitHub] [beam] lukecwik commented on a diff in pull request #25291: Swap setting a context from being on the hot path when we emit elements to only be done during bundle creation and teardown #21250

lukecwik commented on code in PR #25291:
URL: https://github.com/apache/beam/pull/25291#discussion_r1096296097


##########
sdks/java/harness/src/test/java/org/apache/beam/fn/harness/control/ExecutionStateSamplerTest.java:
##########
@@ -335,6 +359,101 @@ public Long answer(InvocationOnMock invocation) throws Throwable {
     expectedLogs.verifyNotLogged("Operation ongoing");
   }
 
+  @Test
+  public void testCountersReturnedAreBasedUponCurrentExecutionState() throws Exception {
+    MillisProvider clock = mock(MillisProvider.class);
+    ExecutionStateSampler sampler =
+        new ExecutionStateSampler(
+            PipelineOptionsFactory.fromArgs("--experiments=state_sampling_period_millis=10")
+                .create(),
+            clock);
+    MetricsContainerStepMap metricsContainerRegistry = new MetricsContainerStepMap();
+    ExecutionStateTracker tracker = sampler.create(metricsContainerRegistry);

Review Comment:
   Done, moved ownership into the execution state sampler. There needs to be a greater refactoring to move the shortIds into some place where the execution state sampler will be responsible for also updating the monitoring data related to the metrics container.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org