Skip to content

Commit 03b4d7b

Browse files
committed
test: undo bench changes
1 parent f956380 commit 03b4d7b

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

test/benchmarks/driverBench/index.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
'use strict';
22

33
const MongoBench = require('../mongoBench');
4-
const process = require('node:process');
54
const os = require('node:os');
6-
const util = require('node:util');
7-
8-
const args = util.parseArgs({
9-
args: process.argv.slice(2),
10-
options: {
11-
grep: {
12-
short: 'g',
13-
type: 'string',
14-
required: false
15-
}
16-
}
17-
});
185

196
const Runner = MongoBench.Runner;
207

218
let bsonType = 'js-bson';
229
// TODO(NODE-4606): test against different driver configurations in CI
2310

11+
const { inspect } = require('util');
2412
const { writeFile } = require('fs/promises');
2513
const { makeParallelBenchmarks, makeSingleBench, makeMultiBench } = require('../mongoBench/suites');
2614

@@ -42,9 +30,7 @@ function average(arr) {
4230
return arr.reduce((x, y) => x + y, 0) / arr.length;
4331
}
4432

45-
const benchmarkRunner = new Runner({
46-
grep: args.values.grep ?? null
47-
})
33+
const benchmarkRunner = new Runner()
4834
.suite('singleBench', suite => makeSingleBench(suite))
4935
.suite('multiBench', suite => makeMultiBench(suite))
5036
.suite('parallel', suite => makeParallelBenchmarks(suite));
@@ -110,7 +96,7 @@ benchmarkRunner
11096
})
11197
.then(data => {
11298
const results = JSON.stringify(data, undefined, 2);
113-
console.log(util.inspect(data, { depth: Infinity, colors: true }));
99+
console.log(inspect(data, { depth: Infinity, colors: true }));
114100
return writeFile('results.json', results);
115101
})
116102
.catch(err => console.error(err));

test/benchmarks/mongoBench/runner.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class Runner {
6363
console.log.apply(console, arguments);
6464
};
6565
this.children = {};
66-
this.grep = options.grep?.toLowerCase() ?? null;
6766
}
6867

6968
/**
@@ -125,12 +124,6 @@ class Runner {
125124
const result = {};
126125

127126
for (const [name, benchmark] of benchmarks) {
128-
if (this.grep != null) {
129-
if (!name.toLowerCase().includes(this.grep)) {
130-
result[name] = 0;
131-
continue;
132-
}
133-
}
134127
this.reporter(` Executing Benchmark "${name}"`);
135128
result[name] = await this._runBenchmark(benchmark);
136129
}

0 commit comments

Comments
 (0)