@Test void testOperationTimeWithInvalidInput() { assertThrows(NullPointerException.class, () -> operationTimeAggregator.computeOverallProcessTime(CORRELATION_ID, Collections.emptyMap())); }
public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) { ProcessTime rootProcessTime = processTimes.get(correlationId); long overallDelayBetweenSteps = processTimes.values() .stream() .mapToLong(ProcessTime::getDelayBetweenSteps) .sum(); return ImmutableProcessTime.copyOf(rootProcessTime) .withDelayBetweenSteps(overallDelayBetweenSteps); }
OperationTimeAggregator { public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) { ProcessTime rootProcessTime = processTimes.get(correlationId); long overallDelayBetweenSteps = processTimes.values() .stream() .mapToLong(ProcessTime::getDelayBetweenSteps) .sum(); return ImmutableProcessTime.copyOf(rootProcessTime) .withDelayBetweenSteps(overallDelayBetweenSteps); } }
OperationTimeAggregator { public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) { ProcessTime rootProcessTime = processTimes.get(correlationId); long overallDelayBetweenSteps = processTimes.values() .stream() .mapToLong(ProcessTime::getDelayBetweenSteps) .sum(); return ImmutableProcessTime.copyOf(rootProcessTime) .withDelayBetweenSteps(overallDelayBetweenSteps); } @Inject  OperationTimeAggregator(FlowableFacade flowableFacade); }
OperationTimeAggregator { public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) { ProcessTime rootProcessTime = processTimes.get(correlationId); long overallDelayBetweenSteps = processTimes.values() .stream() .mapToLong(ProcessTime::getDelayBetweenSteps) .sum(); return ImmutableProcessTime.copyOf(rootProcessTime) .withDelayBetweenSteps(overallDelayBetweenSteps); } @Inject  OperationTimeAggregator(FlowableFacade flowableFacade); Map<String, ProcessTime> collectProcessTimes(String correlationId); ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes); }
OperationTimeAggregator { public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) { ProcessTime rootProcessTime = processTimes.get(correlationId); long overallDelayBetweenSteps = processTimes.values() .stream() .mapToLong(ProcessTime::getDelayBetweenSteps) .sum(); return ImmutableProcessTime.copyOf(rootProcessTime) .withDelayBetweenSteps(overallDelayBetweenSteps); } @Inject  OperationTimeAggregator(FlowableFacade flowableFacade); Map<String, ProcessTime> collectProcessTimes(String correlationId); ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes);  }