INNER CODE UNIT · TypeScript
instance
hasura/graphql-bench · app/queries/src/executors/autocannon/index.ts:112
const instance = autocannon(config, (err, results) => {
if (err) throw err
})
const histogram = hdr.build()
instance.on('response', (client, statusCode, resBytes, responseTime) => {
histogram.recordValue(responseTime)
})
autocannon.track(instance, {
outputStream: this.config.writeStream || process.stdout,
renderProgressBar: true,
renderLatencyTable: true,
renderResultsTable: true,
})
// Wrap this in a Promise to force waiting for Autocannon run to finish
return new Promise<BenchmarkMetrics>((resolve) => {