root name is "." instead of ""

This commit is contained in:
Hannes Mehnert 2019-10-13 13:40:17 +02:00
parent 249796ce6f
commit a579a8e143
2 changed files with 4 additions and 2 deletions

View file

@ -66,7 +66,9 @@ module Name = struct
| _ -> false) | _ -> false)
s (* only LDH (letters, digits, hyphen)! *) s (* only LDH (letters, digits, hyphen)! *)
let to_string ids = String.concat ~sep:"." ids let to_string = function
| [] -> "."
| ids -> String.concat ~sep:"." ids
let to_list x = x let to_list x = x

View file

@ -83,7 +83,7 @@ let unikernel_metrics =
let rec report_vms t name = let rec report_vms t name =
let name' = Name.drop name in let name' = Name.drop name in
let str = if Name.is_root name' then "." else Name.to_string name' in let str = Name.to_string name' in
Metrics.add unikernel_metrics (fun x -> x str) (fun d -> d (t, name')); Metrics.add unikernel_metrics (fun x -> x str) (fun d -> d (t, name'));
if Name.is_root name' then () else report_vms t name' if Name.is_root name' then () else report_vms t name'