This commit is contained in:
Simon Cruanes 2022-03-17 13:08:46 -04:00
parent f7499be0dd
commit 5792c875e8
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -1,10 +1,13 @@
module T = Opentelemetry
let (let@) f x = f x
let run () =
Printf.printf "collector is on %S\n%!" (Opentelemetry_client_ocurl.get_url());
let i = ref 0 in
while true do
let@ (tr,sp) = T.Trace.with_ "loop" in
Unix.sleepf 2.;
let gc = Gc.stat() in
@ -17,9 +20,14 @@ let run () =
incr i;
begin
let@ _ = T.Trace.with_ ~kind:T.Span.Span_kind_client
~trace_id:tr ~parent:sp "alloc" in
(* allocate some stuff *)
let _arr = Sys.opaque_identity @@ Array.make (25 * 25551) 42.0 in
ignore _arr;
Unix.sleepf 0.1;
end;
done
let () =