Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit d7bfc47

Browse files
rkirovchirayuk
authored andcommitted
chore(bp): add min/max numbers to bp report
Closes #1233
1 parent 86de17c commit d7bfc47

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

benchmark/web/bp.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ bp.Report.getTimesPerAction = function(name) {
177177
tpa[c] = {
178178
recent: undefined,
179179
history: [],
180-
avg: {}
180+
avg: {},
181+
min: Number.MAX_VALUE,
182+
max: Number.MIN_VALUE
181183
};
182184
});
183185
}
@@ -194,9 +196,12 @@ bp.Report.rightSizeTimes = function(times) {
194196
};
195197

196198
bp.Report.updateTimes = function(tpa, index, reference, recentTime) {
197-
tpa[reference].recent = recentTime;
198-
tpa[reference].history[index] = recentTime;
199-
tpa[reference].history = bp.Report.rightSizeTimes(tpa[reference].history);
199+
var curTpa = tpa[reference];
200+
curTpa.recent = recentTime;
201+
curTpa.history[index] = recentTime;
202+
curTpa.history = bp.Report.rightSizeTimes(curTpa.history);
203+
curTpa.min = Math.min(curTpa.min, recentTime);
204+
curTpa.max = Math.max(curTpa.max, recentTime);
200205
};
201206

202207
bp.Report.calcStats = function() {

benchmark/web/tree.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
&plusmn; <%= Math.round(testTime.avg.coefficientOfVariation * 100) %>%
7171
<br>
7272
(stddev <%= testTime.avg.stdDev.toFixed(2) %>)
73+
<br>
74+
(min <%= testTime.min.toFixed(2) %> /
75+
max <%= testTime.max.toFixed(2) %>)
7376
</div>
7477
<div class="td col-md-2">
7578
mean: <%= gcTime.avg.mean.toFixed(2) %>ms

0 commit comments

Comments
 (0)