@@ -82,13 +82,14 @@ let common_fields () =
82
82
let get () =
83
83
let open Var in
84
84
let l = ref [] in
85
- Var. iter begin fun attr v ->
85
+ Var. iter begin fun attr' v ->
86
86
let (previous,attr) =
87
- try Hashtbl. find state attr with
87
+ try Hashtbl. find state attr' with
88
88
| Not_found ->
89
- let a = List. map (fun (k , s ) -> escape k, `String s) attr in
89
+ let a = List. map (fun (k , s ) -> escape k, `String s) attr' in
90
90
let x = ref (zero v), a in
91
- Hashtbl. add state attr x; x
91
+ Hashtbl. add state attr' x;
92
+ x
92
93
in
93
94
let this = (common_fields () @ attr : (string * json) list :> (string * [> json ]) list ) in
94
95
match v, ! previous with
@@ -103,7 +104,7 @@ let get () =
103
104
if delta > epsilon_float then begin previous := v; tuck l @@ `Assoc ((" seconds" , `Float delta) :: this) end
104
105
| Count _, Bytes _ | Count _, Time _
105
106
| Bytes _, Count _ | Bytes _, Time _
106
- | Time _ , Count _ | Time _ , Bytes _ -> () (* cannot happen * )
107
+ | Time _ , Count _ | Time _ , Bytes _ -> log #warn " the impossible happened : mismatched type for %S " (show_a attr' )
107
108
end;
108
109
dynamic |> Hashtbl. iter begin fun attr v ->
109
110
let attr = List. map (fun (k , s ) -> escape k, s) attr in
0 commit comments