INNER CODE UNIT · TypeScript
K6Executor
hasura/graphql-bench · app/queries/src/executors/k6/index.ts:40
export class K6Executor extends BenchmarkExecutor {
public tool = BenchmarkTool.K6
private k6BinaryPath = path.join(__dirname, 'k6', 'k6')
private reportPath = path.join(this.baseReportPath, 'k6')
public runCustomBench(bench: CustomBenchmark) {
// Need to set the url, headers, query, and variables ENV or it won't work
if (bench.options.k6?.scenarios) {
for (let scenario in bench.options.k6?.scenarios) {
bench.options.k6.scenarios[scenario].env = this._makeScenarioEnv(bench)
}
}
const queryName = this._makeBenchmarkName(bench)
const metadata = {
queryName,
outputFile: `${queryName}.json`,