mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 03:47:57 -04:00
this way, we can actually use only `trace.core` when we also expect to use compiler-libs.toplevel (which contains a naked `Trace` module, which would cause .cmi collisions). The library `trace` still exists, and just forwards to `trace.core`.
42 lines
1.1 KiB
OCaml
42 lines
1.1 KiB
OCaml
(** A global collector.
|
|
|
|
The collector, if present, is responsible for collecting messages
|
|
and spans, and storing them, recording them, forward them, or
|
|
offering them to other services and processes.
|
|
*)
|
|
|
|
open Types
|
|
|
|
let dummy_span : span = Int64.min_int
|
|
|
|
(** Signature for a collector.
|
|
|
|
This is only relevant to implementors of tracing backends; to instrument
|
|
your code you only need to look at the {!Trace} module. *)
|
|
module type S = sig
|
|
val enter_span :
|
|
?__FUNCTION__:string ->
|
|
__FILE__:string ->
|
|
__LINE__:int ->
|
|
data:(string * user_data) list ->
|
|
string ->
|
|
span
|
|
|
|
val exit_span : span -> unit
|
|
val message : ?span:span -> data:(string * user_data) list -> string -> unit
|
|
|
|
val name_thread : string -> unit
|
|
(** Give a name to the current thread *)
|
|
|
|
val name_process : string -> unit
|
|
(** Give a name to the current process *)
|
|
|
|
val counter_int : string -> int -> unit
|
|
(** Integer counter *)
|
|
|
|
val counter_float : string -> float -> unit
|
|
(** Float counter *)
|
|
|
|
val shutdown : unit -> unit
|
|
(** Shutdown collector, possibly waiting for it to finish sending data. *)
|
|
end
|