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
|
@ -70,9 +70,10 @@ def dashboard_row_battery(panel_id, node):
|
|||
)
|
||||
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||
|> map(fn: (r) => ({{
|
||||
r with
|
||||
_value: float(v: r.energy_now) / float(v: r.energy_full) * 100.0
|
||||
}}))
|
||||
r with
|
||||
_value: float(v: r.energy_now) / float(v: r.energy_full) * 100.0
|
||||
}})
|
||||
)
|
||||
|> drop(columns: ["energy_now", "energy_full"])""",
|
||||
'resultFormat': 'time_series',
|
||||
'select': [[
|
||||
|
@ -182,6 +183,11 @@ def dashboard_row_battery(panel_id, node):
|
|||
r["_field"] == "power_now" and
|
||||
r["host"] == "{node.name}"
|
||||
)
|
||||
|> map(fn: (r) => ({{
|
||||
r with
|
||||
_value: float(v: r._value) / 1000000.0
|
||||
}})
|
||||
)
|
||||
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
||||
|> yield(name: "fan")""",
|
||||
'resultFormat': 'time_series',
|
||||
|
|
Loading…
Reference in a new issue