Skip to content

Commit f87296a

Browse files
committed
chore: print runtime and hw info
1 parent c7e2a00 commit f87296a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/benchmarks/bench.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22
/* eslint-disable no-console */
3+
import os from 'node:os';
34
import path from 'node:path';
45
import url from 'node:url';
56
import process from 'node:process';
@@ -98,6 +99,21 @@ function measureMedianOpsPerSecOfDecrypt(mongoCrypt, toDecrypt, seconds) {
9899
}
99100

100101
function main() {
102+
const hw = os.cpus();
103+
const ram = os.totalmem() / 1024 ** 3;
104+
const platform = { name: hw[0].model, cores: hw.length, ram: `${ram}GB` };
105+
106+
const systemInfo = () =>
107+
[
108+
`\n- cpu: ${platform.name}`,
109+
`- node: ${process.version}`,
110+
`- cores: ${platform.cores}`,
111+
`- arch: ${os.arch()}`,
112+
`- os: ${process.platform} (${os.release()})`,
113+
`- ram: ${platform.ram}\n`
114+
].join('\n');
115+
console.log(systemInfo());
116+
101117
console.log(
102118
`BenchmarkRunner is using ` +
103119
`libmongocryptVersion=${MongoCrypt.libmongocryptVersion}, ` +

0 commit comments

Comments
 (0)