This commit is contained in:
Mateusz Gruszczyński committed 2026-11-08 21:26:30 +01:00
1 parent 213332d0b5
commit 1ac94213e0
13 files changed
+68 -28

No files matched your search

+2 -1
View File
@@ -408,7 +408,7 @@ function cacheOutcomeMix(totals) {
return { counts, percentages: counts.map(value => value / requests * 100), requests };
}
// Percent labels live inside the bar segments; a label that does not fit is hidden
// (the exact count and percentage stay in the segment and legend tooltips).
// (the legend carries the request counts; tooltips give both).
function fitCacheMixLabels() {
const bar = $("cache-mix-bar");
if (!bar) return;
@@ -430,6 +430,7 @@ function renderCacheMix(mix, totalRequests) {
segment.style.width = `${pct}%`;
segment.textContent = mix && pct > 0 ? `${fmt(pct, pct < 10 ? 1 : 0)}%` : "";
const detail = mix ? `${name.toUpperCase()}: ${fmt(mix.counts[i])} (${fmt(pct, 1)}%)` : "";
$(`cache-mix-${name}-count`).textContent = mix ? fmt(mix.counts[i]) : "-";
segment.title = detail; $(`cache-mix-${name}-key`).title = detail;
});
fitCacheMixLabels();