bhisevishal commented on code in PR #25291:
URL: https://github.com/apache/beam/pull/25291#discussion_r1096186102
##########
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:
All the places now we create metricsContainerRegistry and pass this to
sampler.create
if there is no other variation of MetricsContainerStepMap then
sampler.create can auto create new metricsContainerRegistry and other code path
can refer if as tracker.metricsContainerRegistry
--
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]