Skip to content

Commit

Permalink
fix(components): round perf metrics in tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Mar 9, 2022
1 parent 380d1b2 commit e2fdc14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/app-backend-core/src/perf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ export function handleAddPerformanceTag (backend: DevtoolsBackend, ctx: BackendC
let tooltip = '<div class="grid grid-cols-2 gap-2 font-mono text-xs">'
for (const type in measures) {
const d = measures[type]
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>`
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>`
}
tooltip += '</div>'

payload.treeNode.tags.push({
backgroundColor: duration > 30 ? 0xF87171 : 0xFBBF24,
textColor: 0x000000,
label: `${duration} ms`,
label: `${Math.round(duration * 1000) / 1000} ms`,
tooltip,
})
}
Expand Down

0 comments on commit e2fdc14

Please sign in to comment.