mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-12 05:26:17 -04:00
better test
This commit is contained in:
parent
3beacb1f18
commit
3006e293b0
1 changed files with 24 additions and 19 deletions
|
|
@ -1,13 +1,17 @@
|
||||||
|
|
||||||
module T = Opentelemetry
|
module T = Opentelemetry
|
||||||
|
let spf = Printf.sprintf
|
||||||
let (let@) f x = f x
|
let (let@) f x = f x
|
||||||
|
|
||||||
let run () =
|
let run () =
|
||||||
Printf.printf "collector is on %S\n%!" (Opentelemetry_client_ocurl.get_url());
|
Printf.printf "collector is on %S\n%!" (Opentelemetry_client_ocurl.get_url());
|
||||||
let i = ref 0 in
|
let i = ref 0 in
|
||||||
while true do
|
while true do
|
||||||
let@ (tr,sp) = T.Trace.with_ ~service_name:"t1" "loop" in
|
let@ (tr,sp) = T.Trace.with_ ~service_name:"t1" "outer.loop" ~attrs:["i", `Int !i] in
|
||||||
|
|
||||||
|
for j=0 to 4 do
|
||||||
|
|
||||||
|
let@ (tr,sp) = T.Trace.with_ ~service_name:"t1" ~attrs:["j", `Int j] "loop.inner" in
|
||||||
Unix.sleepf 2.;
|
Unix.sleepf 2.;
|
||||||
|
|
||||||
let gc = Gc.stat() in
|
let gc = Gc.stat() in
|
||||||
|
|
@ -28,6 +32,7 @@ let run () =
|
||||||
ignore _arr;
|
ignore _arr;
|
||||||
Unix.sleepf 0.1;
|
Unix.sleepf 0.1;
|
||||||
end;
|
end;
|
||||||
|
done;
|
||||||
done
|
done
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue