mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 03:47:57 -04:00
rename add_data to add_data_to_current_span
This commit is contained in:
parent
bffa5ad209
commit
e0fe99f500
5 changed files with 7 additions and 7 deletions
|
|
@ -53,7 +53,7 @@ module type S = sig
|
|||
(** Exit an explicit span.
|
||||
@since 0.3 *)
|
||||
|
||||
val add_data : (string * user_data) list -> unit
|
||||
val add_data_to_current_span : (string * user_data) list -> unit
|
||||
(** @since Adds data to the current, implicit span.
|
||||
NEXT_RELEASE *)
|
||||
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ let[@inline] exit_manual_span espan : unit =
|
|||
| None -> ()
|
||||
| Some (module C) -> C.exit_manual_span espan
|
||||
|
||||
let[@inline] add_data data : unit =
|
||||
let[@inline] add_data_to_current_span data : unit =
|
||||
if data <> [] then (
|
||||
match A.get collector with
|
||||
| None -> ()
|
||||
| Some (module C) -> C.add_data data
|
||||
| Some (module C) -> C.add_data_to_current_span data
|
||||
)
|
||||
|
||||
let[@inline] add_data_to_manual_span esp data : unit =
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ val with_span :
|
|||
see {!enter_manual_span}.
|
||||
*)
|
||||
|
||||
val add_data : (string * user_data) list -> unit
|
||||
val add_data_to_current_span : (string * user_data) list -> unit
|
||||
(** Add structured data to the current, implicit span (see {!with_span}).
|
||||
Behavior is not specified if there is no current span.
|
||||
@since NEXT_RELEASE *)
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ let collector ~out () : collector =
|
|||
|
||||
Fun.protect ~finally (fun () -> f span)
|
||||
|
||||
let add_data data =
|
||||
let add_data_to_current_span data =
|
||||
if data <> [] then (
|
||||
let tid = get_tid_ () in
|
||||
B_queue.push events (E_add_data { tid; data })
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ let run () =
|
|||
Trace.message "world";
|
||||
Trace.counter_int "n" !n;
|
||||
|
||||
Trace.add_data [ "i", `Int _i ];
|
||||
Trace.add_data_to_current_span [ "i", `Int _i ];
|
||||
|
||||
if _j = 2 then (
|
||||
Trace.add_data [ "j", `Int _j ];
|
||||
Trace.add_data_to_current_span [ "j", `Int _j ];
|
||||
let _sp =
|
||||
Trace.enter_manual_sub_span ~parent:pseudo_async_sp
|
||||
~flavor:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue