mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 04:17:56 -04:00
test
This commit is contained in:
parent
d498d413be
commit
c8d33aa611
1 changed files with 6 additions and 4 deletions
|
|
@ -3,18 +3,20 @@ module T = Opentelemetry
|
||||||
let spf = Printf.sprintf
|
let spf = Printf.sprintf
|
||||||
let (let@) f x = f x
|
let (let@) f x = f x
|
||||||
|
|
||||||
|
let service_name = "t1"
|
||||||
|
|
||||||
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_ ~kind:T.Span.Span_kind_producer
|
let@ (tr,sp) = T.Trace.with_ ~kind:T.Span.Span_kind_producer
|
||||||
~service_name:"t1" "outer.loop" ~attrs:["i", `Int !i] in
|
~service_name "loop.outer" ~attrs:["i", `Int !i] in
|
||||||
|
|
||||||
for j=0 to 4 do
|
for j=0 to 4 do
|
||||||
|
|
||||||
let@ (_,sp) = T.Trace.with_ ~kind:T.Span.Span_kind_internal
|
let@ (_,sp) = T.Trace.with_ ~kind:T.Span.Span_kind_internal
|
||||||
~trace_id:tr
|
~trace_id:tr ~parent:sp
|
||||||
~service_name:"t1" ~attrs:["j", `Int j]
|
~service_name ~attrs:["j", `Int j]
|
||||||
"loop.inner" in
|
"loop.inner" in
|
||||||
Unix.sleepf 2.;
|
Unix.sleepf 2.;
|
||||||
|
|
||||||
|
|
@ -32,7 +34,7 @@ let run () =
|
||||||
let@ _ =
|
let@ _ =
|
||||||
T.Trace.with_ ~kind:T.Span.Span_kind_internal
|
T.Trace.with_ ~kind:T.Span.Span_kind_internal
|
||||||
~trace_id:tr ~parent:sp
|
~trace_id:tr ~parent:sp
|
||||||
~service_name:"t1"
|
~service_name
|
||||||
"alloc" in
|
"alloc" in
|
||||||
(* allocate some stuff *)
|
(* allocate some stuff *)
|
||||||
let _arr = Sys.opaque_identity @@ Array.make (25 * 25551) 42.0 in
|
let _arr = Sys.opaque_identity @@ Array.make (25 * 25551) 42.0 in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue