Skip to content

Commit

Permalink
ci(perf-measures): support KB (#3696)
Browse files Browse the repository at this point in the history
* ci(perf-measures): support `KB`

* wip

* Update perf-measures/bundle-check/scripts/check-bundle-size.ts

Co-authored-by: Katsumi Kato <k2tzumi@users.noreply.github.com>

* Update check-bundle-size.ts

---------

Co-authored-by: Katsumi Kato <k2tzumi@users.noreply.github.com>
  • Loading branch information
EdamAme-x and k2tzumi authored Nov 23, 2024
1 parent 44a50bd commit 8717946
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions perf-measures/bundle-check/scripts/check-bundle-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 8717946

Please sign in to comment.