@Override public void prepareReport() { context.put("all_steps", reportResult.getAllSteps()); int allOccurrences = 0; long allDurations = 0; for (StepObject stepObject : reportResult.getAllSteps()) { allOccurrences += stepObject.getTotalOccurrences(); allDurations += stepObject.getDuration(); } context.put("all_occurrences", allOccurrences); context.put("all_durations", Util.formatDuration(allDurations)); // make sure it does not divide by 0 - may happens if there is no step at all or all results have 0 ms durations context.put("all_max_duration", Util.formatDuration(maxDurationOf(reportResult.getAllSteps()))); long average = allDurations / (allOccurrences == 0 ? 1 : allOccurrences); context.put("all_average_duration", Util.formatDuration(average)); }
@Override public void prepareReport() { context.put("all_steps", reportResult.getAllSteps()); int allOccurrences = 0; long allDurations = 0; for (StepObject stepObject : reportResult.getAllSteps()) { allOccurrences += stepObject.getTotalOccurrences(); allDurations += stepObject.getDuration(); } context.put("all_occurrences", allOccurrences); context.put("all_durations", Util.formatDuration(allDurations)); // make sure it does not divide by 0 - may happens if there is no step at all or all results have 0 ms durations context.put("all_max_duration", Util.formatDuration(maxDurationOf(reportResult.getAllSteps()))); long average = allDurations / (allOccurrences == 0 ? 1 : allOccurrences); context.put("all_average_duration", Util.formatDuration(average)); }