mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-05 12:33:15 +00:00
fix(dashboard_gen): use RATE_WINDOW in rate_per_min calculation
This commit is contained in:
parent
037901fe94
commit
acb73dce0c
@ -71,7 +71,7 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||
"expr": "rate(blocks_produced_total[1m]) * 60",
|
||||
"expr": "rate(blocks_produced_total[$__rate_interval]) * 60",
|
||||
"legendFormat": "produced · blocks/min",
|
||||
"refId": "A"
|
||||
}
|
||||
@ -327,19 +327,19 @@
|
||||
"targets": [
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||
"expr": "rate(submitted_transactions_total[1m]) * 60",
|
||||
"expr": "rate(submitted_transactions_total[$__rate_interval]) * 60",
|
||||
"legendFormat": "submitted",
|
||||
"refId": "A"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||
"expr": "rate(before_mempool_failed_transactions_total[1m]) * 60",
|
||||
"expr": "rate(before_mempool_failed_transactions_total[$__rate_interval]) * 60",
|
||||
"legendFormat": "failed · before mempool",
|
||||
"refId": "B"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||
"expr": "rate(mempool_failed_transactions_total[1m]) * 60",
|
||||
"expr": "rate(mempool_failed_transactions_total[$__rate_interval]) * 60",
|
||||
"legendFormat": "failed · in mempool",
|
||||
"refId": "C"
|
||||
}
|
||||
|
||||
@ -8,3 +8,6 @@ datasources:
|
||||
url: http://prometheus:9090
|
||||
isDefault: true
|
||||
editable: true
|
||||
jsonData:
|
||||
# Must match prometheus.yml's `scrape_interval`
|
||||
timeInterval: 5s
|
||||
|
||||
@ -36,9 +36,10 @@ mod unit;
|
||||
/// than by a per-environment URL.
|
||||
pub const DATASOURCE_UID: &str = "prometheus";
|
||||
|
||||
/// Window every histogram query rates over. `$__rate_interval` tracks the
|
||||
/// panel's zoom, so a percentile covers the range you are actually looking at,
|
||||
/// and an idle window yields no value rather than a zero.
|
||||
/// Window every rate query — counter and histogram alike — rates over.
|
||||
/// `$__rate_interval` tracks the panel's zoom, so the window always covers the
|
||||
/// step Grafana samples at: a fixed one shorter than the step leaves gaps the
|
||||
/// query never looks at, dropping events from the graph entirely.
|
||||
const RATE_WINDOW: &str = "$__rate_interval";
|
||||
|
||||
/// Dashboard variable holding the quantile every percentile query reads.
|
||||
@ -578,7 +579,9 @@ pub fn avg(metric: &str) -> Target {
|
||||
/// A per-minute rate target for a counter metric.
|
||||
#[must_use]
|
||||
pub fn rate_per_min(metric: &str, legend: &str) -> Target {
|
||||
Target::new(format!("rate({metric}[1m]) * 60")).legend(legend)
|
||||
//`rate` is per-second whatever the window, so `* 60` is per-minute regardless of the panel's
|
||||
//`rate` zoom.
|
||||
Target::new(format!("rate({metric}[{RATE_WINDOW}]) * 60")).legend(legend)
|
||||
}
|
||||
|
||||
const fn default_unit() -> Unit {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user