Skip to content

Commit

Permalink
Add % columns
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeLonewolf committed Jun 23, 2023
1 parent 37781f7 commit 2bc7a22
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions scripts/stats_compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const summaryChange = `
difference.layerCount
} | ${((100 * difference.layerCount) / stats1.layerCount).toLocaleString(
undefined,
summaryChange
pctFormat
)} |
| Size (b) | ${stats1.styleSize.toLocaleString(
"en"
Expand All @@ -51,29 +51,36 @@ let layerCountChange = `
## Layer count comparison
| | main | this PR | change |
|-----------|--------------:|-------------:|----------------:|
| | main | this PR | change | % change |
|-----------|--------------:|-------------:|----------------:|----------------:|
`;

for (const layer in difference.layerGroup) {
layerCountChange += `${layer} | ${stats1.layerGroup[layer].layerCount} | ${stats2.layerGroup[layer].layerCount} | ${difference.layerGroup[layer].layerCount} |
layerCountChange += `${layer} | ${stats1.layerGroup[layer].layerCount} | ${
stats2.layerGroup[layer].layerCount
} | ${difference.layerGroup[layer].layerCount} | ${(
difference.layerGroup[layer].layerCount /
stats1.layerGroup[layer].layerCount
).toLocaleString(undefined, pctFormat)}
`;
}

let layerSizeChange = `
## Layer size comparison
| | main | this PR | change |
|-----------|---------------|--------------|-----------------|
| | main | this PR | change | % change |
|-----------|--------------:|-------------:|----------------:|----------------:|
`;

for (const layer in difference.layerGroup) {
layerSizeChange += `${layer} | ${stats1.layerGroup[layer].size.toLocaleString(
"en"
)} | ${stats2.layerGroup[layer].size.toLocaleString(
"en"
)} | ${difference.layerGroup[layer].size.toLocaleString("en")} |
)} | ${difference.layerGroup[layer].size.toLocaleString("en")} | ${(
difference.layerGroup[layer].size / stats1.layerGroup[layer].size
).toLocaleString(undefined, pctFormat)}
`;
}

Expand Down

0 comments on commit 2bc7a22

Please sign in to comment.