mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
details
This commit is contained in:
parent
ee144aec22
commit
0c119c3eff
2 changed files with 4 additions and 6 deletions
|
|
@ -35,8 +35,6 @@ open struct
|
||||||
let k_span_ctx : OTEL.Span_ctx.t Ambient_context.Context.key =
|
let k_span_ctx : OTEL.Span_ctx.t Ambient_context.Context.key =
|
||||||
Ambient_context.Context.new_key ()
|
Ambient_context.Context.new_key ()
|
||||||
|
|
||||||
(* TODO: params *)
|
|
||||||
|
|
||||||
let enter_span (self : state) ~__FUNCTION__ ~__FILE__ ~__LINE__ ~params:_
|
let enter_span (self : state) ~__FUNCTION__ ~__FILE__ ~__LINE__ ~params:_
|
||||||
~(data : (_ * Otrace.user_data) list) ~parent name : Otrace.span =
|
~(data : (_ * Otrace.user_data) list) ~parent name : Otrace.span =
|
||||||
let start_time = OTEL.Clock.now self.clock in
|
let start_time = OTEL.Clock.now self.clock in
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,9 @@ let run_job () =
|
||||||
let _arr : _ array =
|
let _arr : _ array =
|
||||||
Sys.opaque_identity @@ Array.make (25 * 25551) 42.0
|
Sys.opaque_identity @@ Array.make (25 * 25551) 42.0
|
||||||
in
|
in
|
||||||
ignore _arr
|
ignore _arr;
|
||||||
|
|
||||||
|
OT.Span.add_event scope (OT.Event.make "done with alloc")
|
||||||
);
|
);
|
||||||
|
|
||||||
if !sleep_inner > 0. then (
|
if !sleep_inner > 0. then (
|
||||||
|
|
@ -76,10 +78,8 @@ let run_job () =
|
||||||
Atomic.incr num_sleep
|
Atomic.incr num_sleep
|
||||||
);
|
);
|
||||||
|
|
||||||
if j = 4 && !i mod 13 = 0 then failwith "oh no";
|
|
||||||
|
|
||||||
(* simulate a failure *)
|
(* simulate a failure *)
|
||||||
OT.Span.add_event scope (OT.Event.make "done with alloc")
|
if j = 4 && !i mod 13 = 0 then failwith "oh no"
|
||||||
with Failure _ -> ()
|
with Failure _ -> ()
|
||||||
done
|
done
|
||||||
done;
|
done;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue