feat(stat): improve printing

This commit is contained in:
Simon Cruanes 2022-08-14 23:21:22 -04:00
parent 2ab93aee04
commit 08a4ed892d
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -39,10 +39,10 @@ let[@inline] set c x : unit = c.count <- x
let pp_counters out l = let pp_counters out l =
let pp_w out = function let pp_w out = function
| C_int { name; count } -> Fmt.fprintf out "@[:%s %d@]" name count | C_int { name; count } -> Fmt.fprintf out "(@[%s %d@])" name count
| C_float { name; count } -> Fmt.fprintf out "@[:%s %.4f@]" name count | C_float { name; count } -> Fmt.fprintf out "(@[%s %.4f@])" name count
in in
Fmt.fprintf out "(@[stats@ %a@])" Fmt.(iter ~sep:(return "@ ") pp_w) l Fmt.fprintf out "(@[<1>stats@ %a@])" Fmt.(iter ~sep:(return "@ ") pp_w) l
let pp out (self : t) = pp_counters out @@ all self let pp out (self : t) = pp_counters out @@ all self
let global = create () let global = create ()