v0.34.3_hf1
This commit is contained in:
1 parent
8f41b39c26
commit
29d9a7dd6c
10 files changed
+122
-68
No files matched your search
@@ -174,7 +174,6 @@ $("reload-certificates").addEventListener("click", async () => {
|
||||
$("reset-certificate").addEventListener("click", () => { $("certificate-form").reset(); $("certificate-file-source").value = "managed"; syncCertificateFileSource(); });
|
||||
syncCertificateFileSource();
|
||||
|
||||
let cacheMixLastCounters = null, cacheMixLastShares = null, cacheMixLastTotal = 0;
|
||||
let systemSamples = [], connectionOpenSamples = [], connectionExchangeSamples = [], cacheMemorySamples = [], cacheTransientSamples = [], cacheFillSamples = [], cacheColdQueueSamples = [], cacheColdIoSamples = [], cacheColdStorageSamples = [], cacheHitSamples = [], cacheMissSamples = [], cacheBypassSamples = [], lastCacheCounters = null, lastCacheOutcomeRates = null,
|
||||
processCpuSamples = [], processRssSamples = [], networkRxSamples = [], networkTxSamples = [], responseLatencySamples = [], networkInterfaceSamples = new Map(), settingsDirty = new Set();
|
||||
const hiddenNetworkInterfaces = (() => {
|
||||
@@ -332,32 +331,36 @@ function renderNetworkInterfaceCharts(interfaces, appendSample) {
|
||||
}
|
||||
}
|
||||
|
||||
function cacheOutcomeMix(deltas) {
|
||||
if (!Array.isArray(deltas) || deltas.length !== 4 ||
|
||||
deltas.some(value => !Number.isFinite(value) || value < 0)) return null;
|
||||
const [requests, hits, misses, bypasses] = deltas;
|
||||
// Cumulative process counters, not rate-sampler deltas. Never invent OTHER
|
||||
// or force a 100% mix if independently read totals are inconsistent.
|
||||
function cacheOutcomeMix(totals) {
|
||||
if (!Array.isArray(totals) || totals.length !== 4 ||
|
||||
totals.some(value => !Number.isSafeInteger(value) || value < 0)) return null;
|
||||
const [requests, hits, misses, bypasses] = totals;
|
||||
const cacheTotal = hits + misses + bypasses;
|
||||
if (requests <= 0 || cacheTotal > requests) return null;
|
||||
if (requests === 0 || !Number.isSafeInteger(cacheTotal) || cacheTotal > requests) return null;
|
||||
const counts = [hits, misses, bypasses, requests - cacheTotal];
|
||||
return { counts, percentages: counts.map(value => value / requests * 100), requests };
|
||||
}
|
||||
function renderCacheMix(mix) {
|
||||
function renderCacheMix(mix, totalRequests) {
|
||||
const names = ["hit", "miss", "bypass", "other"];
|
||||
const unavailable = t(totalRequests === 0 ? "cacheMixWaiting" : "cacheMixInvalid");
|
||||
names.forEach((name, i) => {
|
||||
const pct = mix ? mix.percentages[i] : 0;
|
||||
$(`cache-mix-${name}`).style.width = `${pct}%`;
|
||||
$(`cache-mix-${name}-count`).textContent = mix ? fmt(mix.counts[i]) : "-";
|
||||
$(`cache-mix-${name}-percent`).textContent = mix ? `${fmt(pct, 1)}%` : "-";
|
||||
});
|
||||
$("cache-mix-headline").textContent = mix ? `${fmt(mix.percentages[0], 1)}% HIT` : "-";
|
||||
$("cache-mix-caption").textContent = mix
|
||||
? t("cacheMixSample").replace("{count}", fmt(mix.requests))
|
||||
: t("cacheMixWaiting");
|
||||
: unavailable;
|
||||
$("cache-mix-bar").setAttribute("aria-label", mix
|
||||
? t("cacheMixAria").replace("{hit}", fmt(mix.counts[0]))
|
||||
.replace("{miss}", fmt(mix.counts[1]))
|
||||
.replace("{bypass}", fmt(mix.counts[2]))
|
||||
.replace("{other}", fmt(mix.counts[3]))
|
||||
: t("cacheMixWaiting"));
|
||||
: unavailable);
|
||||
}
|
||||
function renderDiagnostics(status, appendSample = true, systemSample = appendSample) {
|
||||
const d = status.system || {}, live = status.live_system || d, c = status.cache || {}, m = status.metrics || {};
|
||||
@@ -366,14 +369,8 @@ function renderDiagnostics(status, appendSample = true, systemSample = appendSam
|
||||
const cacheEvents = cacheHits !== null && cacheMisses !== null ? cacheHits + cacheMisses : 0;
|
||||
$("metric-cache-ratio").textContent = cacheEvents > 0 ? `${fmt(cacheHits / cacheEvents * 100, 1)}%` : "-";
|
||||
window.rustProxyExtraOverview?.donut?.("cache-ratio", cacheHits, cacheMisses);
|
||||
if (appendSample) {
|
||||
const counters = [m.requests, c.hits, c.misses, c.bypasses].map(value => value == null ? NaN : Number(value));
|
||||
const delta = rustProxyRateSampling.difference(cacheMixLastCounters, counters,
|
||||
performance.now(), rustProxyRateSampling.cadence("overview_seconds"));
|
||||
cacheMixLastCounters = counters.every(Number.isFinite) ? delta.next : null;
|
||||
cacheMixLastShares = delta.deltas ? cacheOutcomeMix(delta.deltas) : null;
|
||||
}
|
||||
renderCacheMix(cacheMixLastShares);
|
||||
const counters = [m.requests, c.hits, c.misses, c.bypasses].map(value => value == null ? NaN : Number(value));
|
||||
renderCacheMix(cacheOutcomeMix(counters), counters[0]);
|
||||
if (systemSample) {
|
||||
if (d.process_rss_bytes != null) $("metric-rss").textContent = fmtBytes(d.process_rss_bytes);
|
||||
$("process-summary").hidden = d.process_threads == null;
|
||||
|
||||
@@ -32,23 +32,27 @@
|
||||
</div>
|
||||
</article>
|
||||
<article class="stat stat-cache-outcomes" data-dashboard-widget="cache_outcomes">
|
||||
<span data-i18n="cacheMixTitle">Cache outcomes (recent)</span>
|
||||
<span data-i18n="cacheMixTitle">Cache outcomes</span>
|
||||
<strong id="cache-mix-headline">-</strong>
|
||||
<div class="cache-mix-bar" id="cache-mix-bar" role="img" aria-label="Recent request cache outcomes">
|
||||
<div class="cache-mix-bar" id="cache-mix-bar" role="img"
|
||||
aria-label="Cumulative HTTP cache outcomes since service start">
|
||||
<span class="cache-mix-hit" id="cache-mix-hit" style="width:0%"></span>
|
||||
<span class="cache-mix-miss" id="cache-mix-miss" style="width:0%"></span>
|
||||
<span class="cache-mix-bypass" id="cache-mix-bypass" style="width:0%"></span>
|
||||
<span class="cache-mix-other" id="cache-mix-other" style="width:0%"></span>
|
||||
</div>
|
||||
<small class="cache-mix-legend">
|
||||
<span class="cache-mix-hit-key"><i></i>HIT <b id="cache-mix-hit-percent">-</b></span>
|
||||
<span class="cache-mix-miss-key"><i></i>MISS <b id="cache-mix-miss-percent">-</b></span>
|
||||
<span class="cache-mix-bypass-key"><i></i>BYPASS <b id="cache-mix-bypass-percent">-</b></span>
|
||||
<span class="cache-mix-other-key"><i></i><span data-i18n="cacheMixOther">OTHER</span> <b
|
||||
id="cache-mix-other-percent">-</b></span>
|
||||
<span class="cache-mix-hit-key"><i></i>HIT <b><span id="cache-mix-hit-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-hit-percent">-</span></b></span>
|
||||
<span class="cache-mix-miss-key"><i></i>MISS <b><span id="cache-mix-miss-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-miss-percent">-</span></b></span>
|
||||
<span class="cache-mix-bypass-key"><i></i>BYPASS <b><span id="cache-mix-bypass-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-bypass-percent">-</span></b></span>
|
||||
<span class="cache-mix-other-key"><i></i><span data-i18n="cacheMixOther">OTHER</span> <b><span
|
||||
id="cache-mix-other-count">-</span><span class="cache-mix-percent"
|
||||
id="cache-mix-other-percent">-</span></b></span>
|
||||
</small>
|
||||
<small class="cache-mix-caption" id="cache-mix-caption" data-i18n="cacheMixWaiting">Waiting for request
|
||||
samples</small>
|
||||
<small class="cache-mix-caption" id="cache-mix-caption" data-i18n="cacheMixWaiting">No HTTP requests yet</small>
|
||||
</article>
|
||||
<article class="stat" data-dashboard-widget="memory"><span data-i18n="processMemory">Process
|
||||
memory</span><strong id="metric-rss">-</strong><small id="process-summary">-</small>
|
||||
|
||||
@@ -12267,9 +12267,19 @@ html[data-dashboard-density] #panel-overview .dashboard-overview-grid>.card.pool
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend b {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
margin-left: auto;
|
||||
color: var(--text);
|
||||
font: 500 10px var(--mono);
|
||||
overflow-wrap: anywhere;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend .cache-mix-percent {
|
||||
color: var(--muted);
|
||||
font: 400 10px var(--mono);
|
||||
}
|
||||
|
||||
#panel-overview .stat-cache-outcomes .cache-mix-caption {
|
||||
|
||||
Reference in new issue
Block a user