Skip to content

Commit 6adf121

Browse files
authored
[bench] minor code-cleanup in the benchmarking script (#5105)
1 parent 71c4307 commit 6adf121

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

benchmark/sirun/run-all-variants.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const fs = require('fs')
66
const path = require('path')
7-
const { exec, getStdio } = require('./run-util')
7+
const { exec, stdio } = require('./run-util')
88

99
process.env.DD_INSTRUMENTATION_TELEMETRY_ENABLED = 'false'
1010

@@ -18,10 +18,10 @@ const env = Object.assign({}, process.env, { DD_TRACE_STARTUP_LOGS: 'false' })
1818
const variants = metaJson.variants
1919
for (const variant in variants) {
2020
const variantEnv = Object.assign({}, env, { SIRUN_VARIANT: variant })
21-
await exec('sirun', ['meta-temp.json'], { env: variantEnv, stdio: getStdio() })
21+
await exec('sirun', ['meta-temp.json'], { env: variantEnv, stdio })
2222
}
2323
} else {
24-
await exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() })
24+
await exec('sirun', ['meta-temp.json'], { env, stdio })
2525
}
2626

2727
try {

benchmark/sirun/run-one-variant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
'use strict'
44

5-
const { exec, getStdio } = require('./run-util')
5+
const { exec, stdio } = require('./run-util')
66

77
process.env.DD_INSTRUMENTATION_TELEMETRY_ENABLED = 'false'
88

99
const env = Object.assign({}, process.env, { DD_TRACE_STARTUP_LOGS: 'false' })
1010

11-
exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() })
11+
exec('sirun', ['meta-temp.json'], { env, stdio })

benchmark/sirun/run-util.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ function exec (...args) {
1818
})
1919
}
2020

21-
function getStdio () {
22-
return ['inherit', 'pipe', 'inherit']
23-
}
24-
2521
function streamAddVersion (input) {
2622
input.rl = readline.createInterface({ input })
2723
input.rl.on('line', function (line) {
@@ -39,6 +35,6 @@ function streamAddVersion (input) {
3935

4036
module.exports = {
4137
exec,
42-
getStdio,
38+
stdio: ['inherit', 'pipe', 'inherit'],
4339
streamAddVersion
4440
}

0 commit comments

Comments
 (0)