mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Only color benchmark change when delta exceeds 5%
Treat changes within ±5% as noise and show a neutral white circle; only swings beyond 5% get a green/red indicator. The percent value is still always shown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
11397dcba0
commit
101ffff8e2
1 file changed
+5
-3
@@ -109,12 +109,14 @@ function changeCell(before, after, lowerIsBetter) {
|
||||
}
|
||||
|
||||
const percent = Number((((after - before) / before) * 100).toFixed(1));
|
||||
if (percent === 0) {
|
||||
return `:white_circle: ${code('0%')}`;
|
||||
const label = code(`${percent > 0 ? '+' : ''}${trimNumber(percent)}%`);
|
||||
|
||||
if (Math.abs(percent) <= 5) {
|
||||
return `:white_circle: ${label}`;
|
||||
}
|
||||
|
||||
const improved = lowerIsBetter ? percent < 0 : percent > 0;
|
||||
return `${improved ? ':green_circle:' : ':red_circle:'} ${code(`${percent > 0 ? '+' : ''}${trimNumber(percent)}%`)}`;
|
||||
return `${improved ? ':green_circle:' : ':red_circle:'} ${label}`;
|
||||
}
|
||||
|
||||
function detailTable(rows) {
|
||||
|
||||
Reference in new issue
Block a user