From fb1afda6959e55b396ee4c8062f94ffd8815529d Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 3 Dec 2024 01:58:49 +0100 Subject: [PATCH] feat: customizable threshold too --- index.html | 2 +- src/main.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 200fafc..73ea6c4 100644 --- a/index.html +++ b/index.html @@ -87,7 +87,7 @@ function cell(timestamp, rtt) { let d = new Date(timestamp * 1000); let warning = ""; - if (rtt !== null && rtt >= 1000) { + if (rtt !== null && rtt >= %%THRESHOLD%%) { warning = " warning"; } if (rtt === null) { diff --git a/src/main.rs b/src/main.rs index ae2ea79..d7cdf51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,9 @@ struct Config { /// service description shown in web page description: Option, + /// requests taking longer than this limit (in ms) will be marked as "slow" in FE + threshold: Option, + /// how many samples of history to keep //history: usize, @@ -89,7 +92,8 @@ async fn entry(cli: Cli, config: Config, db: Database) -> Result<(), Box