Skip to content

Commit a2920ae

Browse files
committed
chore(tests): unify byte format
1 parent 0637154 commit a2920ae

41 files changed

Lines changed: 132 additions & 78 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/docs/src/benchmarks/server-side-throughput-tests/FrameworkSSRRequestThroughputVersionCharts.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import type { ChartMeasurement } from '../../lib/types'
33
import {
4-
prepareSsrRequestThroughputTestsBodySizeKbHistory,
4+
prepareSsrRequestThroughputTestsBodySizeBytesHistory,
55
prepareSsrRequestThroughputTestsLatencyMsHistory,
66
prepareSsrRequestThroughputTestsOpsPerSecHistory,
77
} from '../../lib/prepare-chart'
@@ -18,7 +18,7 @@ const { versions } = Astro.props
1818
{...prepareSsrRequestThroughputTestsOpsPerSecHistory(versions)}
1919
/>
2020
<VersionLineChart
21-
{...prepareSsrRequestThroughputTestsBodySizeKbHistory(versions)}
21+
{...prepareSsrRequestThroughputTestsBodySizeBytesHistory(versions)}
2222
/>
2323
<VersionLineChart
2424
{...prepareSsrRequestThroughputTestsLatencyMsHistory(versions)}

‎packages/docs/src/benchmarks/server-side-throughput-tests/SSRRequestThroughputBodySizeChart.astro‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import {
3-
prepareSsrRequestThroughputTestsBodySizeKbComparison,
4-
prepareSsrRequestThroughputTestsBodySizeKbMonthlyComparison,
3+
prepareSsrRequestThroughputTestsBodySizeBytesComparison,
4+
prepareSsrRequestThroughputTestsBodySizeBytesMonthlyComparison,
55
runtimeHistory,
66
ssrRequestThroughputStats,
77
} from '../../lib/prepare-chart'
@@ -11,10 +11,10 @@ import ViewSwitcher from '../../components/ViewSwitcher.astro'
1111
import ComparisonBarChart from '../../components/ComparisonBarChart.astro'
1212
import ComparisonLineChart from '../../components/ComparisonLineChart.astro'
1313
14-
const bar = prepareSsrRequestThroughputTestsBodySizeKbComparison(
14+
const bar = prepareSsrRequestThroughputTestsBodySizeBytesComparison(
1515
ssrRequestThroughputStats,
1616
)
17-
const line = prepareSsrRequestThroughputTestsBodySizeKbMonthlyComparison(
17+
const line = prepareSsrRequestThroughputTestsBodySizeBytesMonthlyComparison(
1818
runtimeHistory,
1919
ssrRequestThroughputStats,
2020
)

‎packages/docs/src/lib/chart-measurements.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,31 +661,31 @@ export function prepareSsrRequestThroughputTestsOpsPerSecMonthlyComparison(
661661
)
662662
}
663663

664-
export function prepareSsrRequestThroughputTestsBodySizeKbHistory(
664+
export function prepareSsrRequestThroughputTestsBodySizeBytesHistory(
665665
records: readonly ChartMeasurement[],
666666
): VersionLineChartPayload {
667667
return history(
668668
metricCatalogue['ssrRequestThroughput.bodySize'],
669669
records.map((record) => ({
670670
record,
671-
value: finiteValue(record.ssrRequestThroughput?.bodySize?.value),
671+
value: finiteValue(record.ssrRequestThroughput?.bodySize?.value, 1024),
672672
})),
673673
)
674674
}
675675

676-
export function prepareSsrRequestThroughputTestsBodySizeKbComparison(
676+
export function prepareSsrRequestThroughputTestsBodySizeBytesComparison(
677677
records: readonly ChartMeasurement[],
678678
): PreparedComparisonChart {
679679
return comparison(
680680
metricCatalogue['ssrRequestThroughput.bodySize'],
681681
records.map((record) => ({
682682
record,
683-
value: finiteValue(record.ssrRequestThroughput?.bodySize?.value),
683+
value: finiteValue(record.ssrRequestThroughput?.bodySize?.value, 1024),
684684
})),
685685
)
686686
}
687687

688-
export function prepareSsrRequestThroughputTestsBodySizeKbMonthlyComparison(
688+
export function prepareSsrRequestThroughputTestsBodySizeBytesMonthlyComparison(
689689
history: readonly ChartMeasurement[],
690690
latest: readonly ChartMeasurement[],
691691
now?: Date,
@@ -694,7 +694,7 @@ export function prepareSsrRequestThroughputTestsBodySizeKbMonthlyComparison(
694694
metricCatalogue['ssrRequestThroughput.bodySize'],
695695
history,
696696
latest,
697-
(record) => finiteValue(record.ssrRequestThroughput?.bodySize?.value),
697+
(record) => finiteValue(record.ssrRequestThroughput?.bodySize?.value, 1024),
698698
now,
699699
)
700700
}

‎packages/docs/src/lib/prepare-table.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export const requestThroughputTableData = ssrRequestThroughputStats.flatMap(
319319
package: f.package,
320320
requestThroughput: Math.round(tests.requestThroughput).toLocaleString(),
321321
latency: `${Number(tests.latency.toFixed(3))}${tests.latencyUnit}`,
322-
bodySize: `${tests.bodySize.value} ${tests.bodySize.unit}`,
322+
bodySize: `${Number((tests.bodySize.value / 1024).toFixed(2))} KiB`,
323323
duplicationFactor: `${tests.duplicationFactor.value}x`,
324324
},
325325
]

‎packages/docs/src/lib/request-throughput.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const benchmark = {
3232
},
3333
latency: { mean: 16, median: 4, min: 4, max: 40, unit: 'ms' },
3434
totalRequests: { value: 9, unit: 'requests' },
35-
bodySize: { value: 20.5, unit: 'KiB' },
35+
bodySize: { value: 20_992, unit: 'bytes' },
3636
duplicationFactor: { value: 1.25, unit: 'ratio' },
3737
} satisfies NonNullable<FrameworkResult['ssrRequestThroughput']>
3838

@@ -65,7 +65,7 @@ test('legacy mean latency remains distinct from the reported request median', ()
6565
avgLatency: { value: 4, unit: 'ms' },
6666
medianLatency: { value: 2, unit: 'ms' },
6767
requests: { value: 64, unit: 'requests' },
68-
bodySize: { value: 20, unit: 'KiB' },
68+
bodySize: { value: 20_480, unit: 'bytes' },
6969
duplicationFactor: { value: 1, unit: 'ratio' },
7070
} satisfies NonNullable<FrameworkResult['ssrRequestThroughput']>
7171
const normalized = formatThroughput(legacy)

‎packages/results/data/astro/latest.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@
570570
"unit": "requests"
571571
},
572572
"bodySize": {
573-
"value": 96.89,
574-
"unit": "KiB"
573+
"value": 99215,
574+
"unit": "bytes"
575575
},
576576
"duplicationFactor": {
577577
"value": 1,

‎packages/results/data/astro/versions/7.4.12.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@
570570
"unit": "requests"
571571
},
572572
"bodySize": {
573-
"value": 96.89,
574-
"unit": "KiB"
573+
"value": 99215,
574+
"unit": "bytes"
575575
},
576576
"duplicationFactor": {
577577
"value": 1,

‎packages/results/data/baseline-html/latest.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@
179179
"unit": "requests"
180180
},
181181
"bodySize": {
182-
"value": 96.83,
183-
"unit": "KiB"
182+
"value": 99154,
183+
"unit": "bytes"
184184
},
185185
"duplicationFactor": {
186186
"value": 1,

‎packages/results/data/baseline-html/versions/24.22.1.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@
179179
"unit": "requests"
180180
},
181181
"bodySize": {
182-
"value": 96.83,
183-
"unit": "KiB"
182+
"value": 99154,
183+
"unit": "bytes"
184184
},
185185
"duplicationFactor": {
186186
"value": 1,

‎packages/results/data/next/latest.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@
574574
"unit": "requests"
575575
},
576576
"bodySize": {
577-
"value": 203.36,
578-
"unit": "KiB"
577+
"value": 208241,
578+
"unit": "bytes"
579579
},
580580
"duplicationFactor": {
581581
"value": 2,

0 commit comments

Comments
 (0)