This commit is contained in:
Mateusz Gruszczyński committed 2026-10-15 16:15:49 +02:00
1 parent 5dd802ae83
commit a286355b0e
22 files changed
+447 -70

No files matched your search

+4 -3
View File
@@ -87,7 +87,7 @@ window.rustProxyWebOverview = (() => {
return output;
}
function smallPath(values) {
const peak = Math.max(1, ...values.filter(v => v != null));
const peak = window.rustProxyChartScale.peak("web:php-small", "rate", [values]);
return values.filter(value => value !== null).map((value, i, present) => `${i * 300 / Math.max(1, present.length - 1)},${55 - value / peak * 50}`).join(" ");
}
function ring(id, amounts) {
@@ -173,7 +173,8 @@ window.rustProxyWebOverview = (() => {
names.forEach((_, i) => { series[i].push(set[id]?.[i] ?? null); window.rustProxyOverviewSamples.trim(series[i]); });
histories.set(id, series);
}
const peak = Math.max(1, ...series.flat().filter(v => v !== null));
const unit = id === "www_latency" ? "ms" : id === "www_traffic" ? "bytes/s" : "rate";
const peak = window.rustProxyChartScale.peak(`web:${id}`, unit, series);
names.forEach((name, i) => {
const value = set[id]?.[i];
const label = id === "www_latency" ? (value == null ? "-" : `${fmt(value, 1)} ms`)
@@ -216,7 +217,7 @@ window.rustProxyWebOverview = (() => {
}
}
}
function reset() { histories.clear(); serviceBaselines.clear(); baseline = null; last = null; revision = null; }
function reset() { histories.clear(); serviceBaselines.clear(); baseline = null; last = null; revision = null; window.rustProxyChartScale.reset("web:"); }
window.rustProxyOverviewSamples.onChange(() => {
for (const history of histories.values()) {
if (Array.isArray(history[0])) history.forEach(window.rustProxyOverviewSamples.trim);