Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions JetStreamDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ function displayCategoryScores() {
}

function getIterationCount(plan) {
if (JetStreamParams.testIterationCountMap.has(plan.name))
return JetStreamParams.testIterationCountMap.get(plan.name);
if (plan.name in JetStreamParams.testIterationCountMap)
return JetStreamParams.testIterationCountMap[plan.name];
if (JetStreamParams.testIterationCount)
return JetStreamParams.testIterationCount;
if (plan.iterations)
Expand All @@ -69,8 +69,8 @@ function getIterationCount(plan) {
}

function getWorstCaseCount(plan) {
if (JetStreamParams.testWorstCaseCountMap.has(plan.name))
return JetStreamParams.testWorstCaseCountMap.get(plan.name);
if (plan.name in JetStreamParams.testWorstCaseCountMap)
return JetStreamParams.testWorstCaseCountMap[plan.name];
if (JetStreamParams.testWorstCaseCount)
return JetStreamParams.testWorstCaseCount;
if (plan.worstCaseCount !== undefined)
Expand Down
3 changes: 2 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ load("./params.js");

async function runJetStream() {
if (!JetStreamParams.isDefault) {
console.warn(`Using non standard params: ${JSON.stringify(JetStreamParams, null, 2)}`)
const paramsDiff = JetStreamParams.nonDefaultParams;
console.warn(`Using non standard params: ${JSON.stringify(paramsDiff, null, 2)}`)
}
try {
await JetStream.initialize();
Expand Down
20 changes: 17 additions & 3 deletions params.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

const defaultEmptyMap = Object.freeze({});

class Params {
// Enable a detailed developer menu to change the current Params.
Expand All @@ -41,8 +42,11 @@ class Params {
RAMification = false;
dumpJSONResults = false;
dumpTestList = false;
testIterationCountMap = new Map();
testWorstCaseCountMap = new Map();
// Override iteration and worst-case counts per workload.
// Example:
// testIterationCountMap = { "acorn-wtb": 5 };
testIterationCountMap = defaultEmptyMap;
testWorstCaseCountMap = defaultEmptyMap;

customPreIterationCode = undefined;
customPostIterationCode = undefined;
Expand All @@ -57,7 +61,7 @@ class Params {
_copyFromSearchParams(sourceParams) {
this.startAutomatically = this._parseBooleanParam(sourceParams, "startAutomatically");
this.developerMode = this._parseBooleanParam(sourceParams, "developerMode");
this.shouldReport = this._parseBooleanParam(sourceParams, "report");
this.shouldReport = this._parseBooleanParam(sourceParams, "shouldReport");
this.prefetchResources = this._parseBooleanParam(sourceParams, "prefetchResources");
this.RAMification = this._parseBooleanParam(sourceParams, "RAMification");
this.dumpJSONResults = this._parseBooleanParam(sourceParams, "dumpJSONResults");
Expand Down Expand Up @@ -134,6 +138,16 @@ class Params {
get isDefault() {
return this === DefaultJetStreamParams;
}

get nonDefaultParams() {
const diff = Object.create(null);
for (const [key, value] of Object.entries(this)) {
if (value !== DefaultJetStreamParams[key]) {
diff[key] = value;
}
}
return diff;
}
}

const DefaultJetStreamParams = new Params();
Expand Down
Loading