File tree Expand file tree Collapse file tree
runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,12 +58,24 @@ private static void printStats(long bytesPerRun, List<Double> durations) {
5858 durationVariance += (duration - durationMean ) * (duration - durationMean ) / n ;
5959 }
6060
61+ // Median duration
62+ double [] sortedDurations = durations .stream ().mapToDouble (Double ::doubleValue ).sorted ().toArray ();
63+ int dlen = sortedDurations .length ;
64+ double durationMedian = (dlen % 2 == 1 )
65+ ? sortedDurations [dlen / 2 ]
66+ : (sortedDurations [dlen / 2 - 1 ] + sortedDurations [dlen / 2 ]) / 2.0 ;
67+
6168 System .out .printf (
62- "Overall stats; Throughput Mean:%.3f Gb/s Throughput Median :%.3f Gb/s Throughput Variance:%.3f Gb/s Duration Mean :%.3f s Duration Variance:%.3f s %n" ,
69+ "Overall stats (mean); Throughput:%.3f Gb/s Duration:%.3f s%n" ,
6370 gbpsMean ,
71+ durationMean );
72+ System .out .printf (
73+ "Overall stats (median); Throughput:%.3f Gb/s Duration:%.3f s%n" ,
6474 gbpsMedian ,
75+ durationMedian );
76+ System .out .printf (
77+ "Overall stats (variance); Throughput:%.3f Gb/s Duration:%.3f s%n" ,
6578 gbpsVariance ,
66- durationMean ,
6779 durationVariance );
6880 }
6981
You can’t perform that action at this time.
0 commit comments