INNER CODE UNIT · TypeScript
Wrk2Executor
hasura/graphql-bench · app/queries/src/executors/wrk2/index.ts:30
export class Wrk2Executor extends BenchmarkExecutor {
public tool = BenchmarkTool.WRK2
private reportPath = path.join(this.baseReportPath, 'wrk2')
private _wrk2OutputToBenchmarkMetric(
params: WrkStatsToBenchmarkMetricParams
): BenchmarkMetrics {
const { name, stats, start, end, hdrHistogramStdout } = params
const findPercentile = (stats, number) =>
stats.latency_distribution.find((it) => it.percentile == number)
return {
name,
requests: {
average: stats.requests_per_second,
count: stats.requests,
},
response: {
totalBytes: stats.bytes,