bundles/grafana: fix value for battery dashboard row
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
e17d1ab02f
commit
7969ae9ebe
1 changed files with 9 additions and 3 deletions
|
@ -72,7 +72,8 @@ def dashboard_row_battery(panel_id, node):
|
||||||
|> map(fn: (r) => ({{
|
|> map(fn: (r) => ({{
|
||||||
r with
|
r with
|
||||||
_value: float(v: r.energy_now) / float(v: r.energy_full) * 100.0
|
_value: float(v: r.energy_now) / float(v: r.energy_full) * 100.0
|
||||||
}}))
|
}})
|
||||||
|
)
|
||||||
|> drop(columns: ["energy_now", "energy_full"])""",
|
|> drop(columns: ["energy_now", "energy_full"])""",
|
||||||
'resultFormat': 'time_series',
|
'resultFormat': 'time_series',
|
||||||
'select': [[
|
'select': [[
|
||||||
|
@ -182,6 +183,11 @@ def dashboard_row_battery(panel_id, node):
|
||||||
r["_field"] == "power_now" and
|
r["_field"] == "power_now" and
|
||||||
r["host"] == "{node.name}"
|
r["host"] == "{node.name}"
|
||||||
)
|
)
|
||||||
|
|> map(fn: (r) => ({{
|
||||||
|
r with
|
||||||
|
_value: float(v: r._value) / 1000000.0
|
||||||
|
}})
|
||||||
|
)
|
||||||
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
||||||
|> yield(name: "fan")""",
|
|> yield(name: "fan")""",
|
||||||
'resultFormat': 'time_series',
|
'resultFormat': 'time_series',
|
||||||
|
|
Loading…
Reference in a new issue