rename add_data to add_data_to_current_span

This commit is contained in:
Simon Cruanes 2023-09-01 08:52:39 -04:00
parent bffa5ad209
commit e0fe99f500
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
5 changed files with 7 additions and 7 deletions

View file

@ -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 *)

View file

@ -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 =

View file

@ -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 *)

View file

@ -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 })

View file

@ -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: