Skip to content

Commit e2fdc14

Browse files
committed
fix(components): round perf metrics in tree
1 parent 380d1b2 commit e2fdc14

File tree

1 file changed

+2
-2
lines changed
  • packages/app-backend-core/src

1 file changed

+2
-2
lines changed

packages/app-backend-core/src/perf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ export function handleAddPerformanceTag (backend: DevtoolsBackend, ctx: BackendC
127127
let tooltip = '<div class="grid grid-cols-2 gap-2 font-mono text-xs">'
128128
for (const type in measures) {
129129
const d = measures[type]
130-
tooltip += `<div>${type}</div><div class="text-right text-black rounded px-1 ${d > 30 ? 'bg-red-400' : d > 10 ? 'bg-yellow-400' : 'bg-green-400'}">${d} ms</div>`
130+
tooltip += `<div>${type}</div><div class="text-right text-black rounded px-1 ${d > 30 ? 'bg-red-400' : d > 10 ? 'bg-yellow-400' : 'bg-green-400'}">${Math.round(d * 1000) / 1000} ms</div>`
131131
}
132132
tooltip += '</div>'
133133

134134
payload.treeNode.tags.push({
135135
backgroundColor: duration > 30 ? 0xF87171 : 0xFBBF24,
136136
textColor: 0x000000,
137-
label: `${duration} ms`,
137+
label: `${Math.round(duration * 1000) / 1000} ms`,
138138
tooltip,
139139
})
140140
}

0 commit comments

Comments
 (0)