v0.33.0
This commit is contained in:
1 parent
bbfa8cbc3f
commit
2ccc598b12
49 files changed
+4771
-639
No files matched your search
@@ -1,5 +1,5 @@
|
||||
window.rustProxyWideOverview = (() => {
|
||||
const limit = 60;
|
||||
const limit = () => window.rustProxyOverviewSamples?.getLimit?.() ?? 60;
|
||||
const configurations = {
|
||||
wide_protocol_rates: {
|
||||
unit: "rate", names: ["h1", "h2", "h3"], counters: s =>
|
||||
@@ -39,6 +39,16 @@ window.rustProxyWideOverview = (() => {
|
||||
probes.length ? probes.reduce((total, m) => total + Number(m.latency_ms), 0) / probes.length : null];
|
||||
}
|
||||
},
|
||||
wide_transform_activity: {
|
||||
unit: "rate", names: ["applied", "cache_hits", "skipped", "errors"], total: true,
|
||||
counters: s => [s.transform_metrics?.applied, s.transform_metrics?.cache_hits,
|
||||
s.transform_metrics?.skipped, s.transform_metrics?.errors]
|
||||
},
|
||||
wide_compression_activity: {
|
||||
unit: "rate", names: ["gzip", "br", "zstd", "deflate"], total: true,
|
||||
counters: s => [s.metrics?.compression_gzip, s.metrics?.compression_br,
|
||||
s.metrics?.compression_zstd, s.metrics?.compression_deflate]
|
||||
},
|
||||
};
|
||||
const history = new Map(), baselines = new Map(), last = new Map();
|
||||
let revision = null;
|
||||
@@ -81,7 +91,7 @@ window.rustProxyWideOverview = (() => {
|
||||
if (record) {
|
||||
values.forEach((value, i) => {
|
||||
series[i].push(value);
|
||||
if (series[i].length > limit) series[i].shift();
|
||||
if (series[i].length > limit()) series[i].shift();
|
||||
});
|
||||
history.set(id, series);
|
||||
last.set(id, values);
|
||||
@@ -95,9 +105,15 @@ window.rustProxyWideOverview = (() => {
|
||||
$(`overview-wide-${id}-${key}-line`)?.setAttribute("d", path(series[i], peak));
|
||||
});
|
||||
const summary = $(`overview-wide-${id}-summary`);
|
||||
if (summary) summary.textContent = format(values[0], config.unit);
|
||||
if (summary) summary.textContent = config.total
|
||||
? format(values.every(value => value !== null) ? values.reduce((sum, value) => sum + value, 0) : null, config.unit)
|
||||
: format(values[0], config.unit);
|
||||
}
|
||||
}
|
||||
function reset() { history.clear(); baselines.clear(); last.clear(); revision = null; }
|
||||
window.rustProxyOverviewSamples?.onChange?.(() => {
|
||||
for (const series of history.values()) for (const values of series) window.rustProxyOverviewSamples.trim(values);
|
||||
if (typeof latestStatus !== "undefined" && latestStatus && currentPanel === "overview") render(latestStatus, false);
|
||||
});
|
||||
return { render, reset };
|
||||
})();
|
||||
Reference in new issue
Block a user