use of org.apache.beam.runners.dataflow.worker.counters.CounterFactory.CounterDistribution in project beam by apache.
the class DataflowExecutionStateTrackerTest method assertElementProcessingTimeCounter.
private void assertElementProcessingTimeCounter(NameContext step, int millis, int bucketOffset) {
CounterName counterName = ElementExecutionTracker.COUNTER_NAME.withOriginalName(step);
Counter<?, CounterDistribution> counter = (Counter<?, CounterFactory.CounterDistribution>) counterSet.getExistingCounter(counterName);
assertNotNull(counter);
CounterFactory.CounterDistribution distribution = counter.getAggregate();
assertThat(distribution, equalTo(CounterFactory.CounterDistribution.builder().minMax(millis, millis).count(1).sum(millis).sumOfSquares(millis * millis).buckets(bucketOffset, Lists.newArrayList(1L)).build()));
}
Aggregations