test: in emit1, use GC_metrics

This commit is contained in:
Simon Cruanes 2022-04-11 16:33:05 -04:00
parent 3d0d031bcd
commit 1b1b980211
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -8,17 +8,7 @@ let sleep_outer = ref 2.0
let run () =
Printf.printf "collector is on %S\n%!" (Opentelemetry_client_ocurl.get_url());
(* regularly emit some metrics *)
let emit_gc() =
let gc = Gc.stat() in
T.Metrics.(
emit [
gauge ~name:"ocaml_opentracing.test.major_heap_words" [int gc.Gc.heap_words];
sum ~name:"ocaml_opentracing.test.minor_allocated" [float gc.Gc.minor_words];
]);
in
let _al = Gc.create_alarm emit_gc in
T.GC_metrics.basic_setup();
let i = ref 0 in
while true do