mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-10 04:35:46 -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
|
||||
|
||||
let spf = Printf.sprintf
|
||||
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_ ~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.;
|
||||
|
||||
let gc = Gc.stat() in
|
||||
|
|
@ -28,6 +32,7 @@ let run () =
|
|||
ignore _arr;
|
||||
Unix.sleepf 0.1;
|
||||
end;
|
||||
done;
|
||||
done
|
||||
|
||||
let () =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue