Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set proper unit for "Score" Metric #311

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions resources/benchmark-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ class RAFTestInvoker extends TestInvoker {

// https://stackoverflow.com/a/47593316
function seededHashRandomNumberGenerator(a) {
return function() {
var t = a += 0x6D2B79F5;
t = Math.imul(t ^ t >>> 15, t | 1);
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
return ((t ^ t >>> 14) >>> 0);
}
return function () {
var t = a += 0x6d2b79f5;
t = Math.imul(t ^ (t >>> 15), t | 1);
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
return (t ^ (t >>> 14)) >>> 0;
};
}

export class BenchmarkRunner {
Expand All @@ -333,9 +333,9 @@ export class BenchmarkRunner {
this._page = null;
this._metrics = null;
this._iterationCount = params.iterationCount;
if (params.shuffleSeed !== "off") {
if (params.shuffleSeed !== "off")
this._suiteOrderRandomNumberGenerator = seededHashRandomNumberGenerator(params.shuffleSeed);
}

}

async runMultipleIterations(iterationCount) {
Expand Down Expand Up @@ -549,7 +549,7 @@ export class BenchmarkRunner {
}

_appendIterationMetrics() {
const getMetric = (name) => this._metrics[name] || (this._metrics[name] = new Metric(name));
const getMetric = (name, unit = "ms") => this._metrics[name] || (this._metrics[name] = new Metric(name, unit));
const iterationTotalMetric = (i) => {
if (i >= params.iterationCount)
throw new Error(`Requested iteration=${i} does not exist.`);
Expand Down Expand Up @@ -580,7 +580,7 @@ export class BenchmarkRunner {
for (let i = 0; i < this._iterationCount; i++)
iterationTotalMetric(i);
getMetric("Geomean");
getMetric("Score");
getMetric("Score", "score");
}

const geomean = getMetric("Geomean");
Expand Down