From 8717946fe14025b430a6d6dc694bef2491d48c64 Mon Sep 17 00:00:00 2001 From: EdamAmex <121654029+EdamAme-x@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:02:04 +0900 Subject: [PATCH] ci(perf-measures): support `KB` (#3696) * ci(perf-measures): support `KB` * wip * Update perf-measures/bundle-check/scripts/check-bundle-size.ts Co-authored-by: Katsumi Kato * Update check-bundle-size.ts --------- Co-authored-by: Katsumi Kato --- .../bundle-check/scripts/check-bundle-size.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/perf-measures/bundle-check/scripts/check-bundle-size.ts b/perf-measures/bundle-check/scripts/check-bundle-size.ts index 646ce931f..350f4d249 100644 --- a/perf-measures/bundle-check/scripts/check-bundle-size.ts +++ b/perf-measures/bundle-check/scripts/check-bundle-size.ts @@ -19,12 +19,21 @@ async function main() { const bundleSize = fs.statSync(tempFilePath).size const metrics = [] + metrics.push({ - key: 'bundle-size', - name: 'Bundle Size', + key: 'bundle-size-b', + name: 'Bundle Size (B)', value: bundleSize, unit: 'B', }) + + metrics.push({ + key: 'bundle-size-kb', + name: 'Bundle Size (KB)', + value: parseFloat((bundleSize / 1024).toFixed(2)), + unit: 'K', + }) + const benchmark = { key: 'bundle-size-check', name: 'Bundle size check',