vmm_influxdb: if there are no vmm stats, don\t report them

This commit is contained in:
Hannes Mehnert 2018-09-30 12:13:24 +02:00
parent 38094a53e3
commit b90bae0340

View file

@ -220,9 +220,9 @@ let rec read_sock_write_tcp c ?fd addr addrtype =
Lwt.return (Some fd) Lwt.return (Some fd)
| Ok (name, (ru, vmm, ifs)) -> | Ok (name, (ru, vmm, ifs)) ->
let ru = P.encode_ru name ru in let ru = P.encode_ru name ru in
let vmm = P.encode_vmm name vmm in let vmm = match vmm with [] -> [] | _ -> [ P.encode_vmm name vmm ] in
let taps = List.map (P.encode_if name) ifs in let taps = List.map (P.encode_if name) ifs in
let out = (String.concat ~sep:"\n" (ru :: vmm :: taps)) ^ "\n" in let out = (String.concat ~sep:"\n" (ru :: vmm @ taps)) ^ "\n" in
Logs.debug (fun m -> m "writing %d via tcp" (String.length out)) ; Logs.debug (fun m -> m "writing %d via tcp" (String.length out)) ;
Vmm_lwt.write_wire fd (Cstruct.of_string out) >>= function Vmm_lwt.write_wire fd (Cstruct.of_string out) >>= function
| Ok () -> | Ok () ->