Skip to content

Commit

Permalink
IH-543: future proof by parsing Watts as float
Browse files Browse the repository at this point in the history
Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Apr 17, 2024
1 parent c927922 commit 1b27cd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let get_dcmi_power_reading () =
if k = "Instantaneous power reading" then
let* watts, units = Astring.String.cut ~sep:" " v in
if units = "Watts" then
Some (Int64.of_string watts)
Some (Float.of_string watts)
else
None
else
Expand All @@ -64,7 +64,7 @@ let gen_dcmi_power_reading value =
( Rrd.Host
, Ds.ds_make ~name:"DCMI-power-reading"
~description:"Host power usage reported by IPMI DCMI"
~value:(Rrd.VT_Int64 value) ~ty:Rrd.Gauge ~default:true ~units:"W" ~min:Float.min_float ~max:65534.
~value:(Rrd.VT_Float value) ~ty:Rrd.Gauge ~default:true ~units:"W" ~min:Float.min_float ~max:65534.
()
)

Expand Down

0 comments on commit 1b27cd4

Please sign in to comment.