mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
test
This commit is contained in:
parent
f7499be0dd
commit
5792c875e8
1 changed files with 11 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
(* allocate some stuff *)
|
||||
let _arr = Sys.opaque_identity @@ Array.make (25 * 25551) 42.0 in
|
||||
ignore _arr;
|
||||
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 () =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue