|
@@ -42,8 +42,7 @@ struct
|
|
|
(ListFormat.fmt {init = "{", sep= ",", final = "}",
|
|
|
fmt = fn (label, value) => label ^ "=\"" ^ (String.translate esc value) ^ "\""}
|
|
|
labels) ^ " " ^
|
|
|
- scalar ^ " " ^
|
|
|
- (!timestamp) ^ newline
|
|
|
+ scalar ^ newline
|
|
|
end
|
|
|
|
|
|
(* exnMessage from JSONUtil - slightly extended *)
|
|
@@ -271,7 +270,7 @@ struct
|
|
|
case forward of SOME forward' => SOME ("forward", Real.toString(forward')) | NONE => NONE,
|
|
|
case mgmt_tx of SOME mgmt_tx' => SOME ("mgmt_tx", Real.toString(mgmt_tx')) | NONE => NONE,
|
|
|
case mgmt_rx of SOME mgmt_rx' => SOME ("mgmt_rx", Real.toString(mgmt_rx')) | NONE => NONE]
|
|
|
- fun item2prom (key, value) = (key, stats_prefix ^ key ^ "{hostname=\"" ^ hostname ^ "\",node_id=\"" ^ node_id ^ "\",branch=\"" ^ branch ^ "\",firmware=\"" ^ firmware ^ "\",model=\"" ^ model ^ "\"} " ^ value ^ " " ^ !timestamp ^ "\n")
|
|
|
+ fun item2prom (key, value) = (key, stats_prefix ^ key ^ "{hostname=\"" ^ hostname ^ "\",node_id=\"" ^ node_id ^ "\",branch=\"" ^ branch ^ "\",firmware=\"" ^ firmware ^ "\",model=\"" ^ model ^ "\"} " ^ value ^ "\n")
|
|
|
in List.mapPartial (fn (SOME i) => SOME (item2prom i) | NONE => NONE) items
|
|
|
end
|
|
|
|