We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
--output-json
1 parent b7438b9 commit 0766b7fCopy full SHA for 0766b7f
packages/vitest/src/node/reporters/benchmark/table/index.ts
@@ -129,6 +129,7 @@ interface FormattedBenchmarkGroup {
129
export type FormattedBenchmarkResult = Omit<BenchmarkResult, 'samples'> & {
130
id: string
131
sampleCount: number
132
+ median: number
133
}
134
135
function createFormattedBenchamrkReport(files: File[]) {
@@ -145,6 +146,9 @@ function createFormattedBenchamrkReport(files: File[]) {
145
146
benchmarks.push({
147
id: t.id,
148
sampleCount: samples.length,
149
+ median: samples.length % 2
150
+ ? samples[Math.floor(samples.length / 2)]
151
+ : (samples[samples.length / 2] + samples[samples.length / 2 - 1]) / 2,
152
...rest,
153
})
154
0 commit comments