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

Commit 13e87e0

Browse files
committed
feat(benchmark): add standard deviation to report
1 parent 1f59d11 commit 13e87e0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

benchmark/web/bp.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ bp.calcStats = function() {
252252
tpa = bp.getTimesPerAction(stepName),
253253
reportModel,
254254
avg,
255-
timesConfidenceInterval;
255+
timesConfidenceInterval,
256+
timesStandardDeviation;
256257

257258
bp.updateTimes(tpa, tpa.nextEntry, 'gcTimes', gcTimeForStep);
258259
bp.updateTimes(tpa, tpa.nextEntry, 'garbageTimes', garbageTimeForStep / 1e3);
@@ -266,16 +267,17 @@ bp.calcStats = function() {
266267
tpa.gcTimes,
267268
tpa.garbageTimes,
268269
tpa.retainedTimes);
269-
270+
timesStandardDeviation = bp.Statistics.calculateStandardDeviation(tpa.times, avg.time);
270271
timesConfidenceInterval = bp.Statistics.calculateConfidenceInterval(
271-
bp.Statistics.calculateStandardDeviation(tpa.times, avg.time),
272+
timesStandardDeviation,
272273
tpa.times.length
273274
);
274275

275276
reportModel = bp.generateReportModel({
276277
name: stepName,
277278
avg: avg,
278279
times: tpa.fmtTimes,
280+
timesStandardDeviation: timesStandardDeviation,
279281
timesRelativeMarginOfError: bp.Statistics.calculateRelativeMarginOfError(timesConfidenceInterval, avg.time),
280282
gcTimes: tpa.fmtGcTimes,
281283
garbageTimes: tpa.fmtGarbageTimes,

benchmark/web/tree.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
<td class="average">
7171
test:<%= avg.time %>ms &plusmn; <%- Math.round(timesRelativeMarginOfError * 100) %>%
7272
<br>
73+
deviation: <%= timesStandardDeviation %>
74+
<br>
7375
gc:<%= avg.gcTime %>ms
7476
<br>
7577
combined: <%= avg.combinedTime %>ms

0 commit comments

Comments
 (0)