diff --git a/src/subscriber/dune b/src/subscriber/dune deleted file mode 100644 index b8b3da0..0000000 --- a/src/subscriber/dune +++ /dev/null @@ -1,18 +0,0 @@ -(library - (name trace_subscriber) - (public_name trace.subscriber) - (private_modules time_ thread_) - (libraries - (re_export trace.core) - (select - thread_.ml - from - (threads -> thread_.real.ml) - (-> thread_.dummy.ml)) - (select - time_.ml - from - (mtime mtime.clock.os -> time_.mtime.ml) - (mtime mtime.clock.jsoo -> time_.mtime.ml) - (unix -> time_.unix.ml) - (-> time_.dummy.ml)))) diff --git a/src/subscriber/span_sub.ml b/src/subscriber/span_sub.ml deleted file mode 100644 index 3be5ef9..0000000 --- a/src/subscriber/span_sub.ml +++ /dev/null @@ -1,39 +0,0 @@ -(** Subscriber span. - - This is the concrete representation of spans used in [Trace_subscriber]. - - @since NEXT_RELEASE *) - -open Trace_core - -type span_id = int64 -(** Unique ID *) - -type trace_id = int64 -(** Unique trace ID *) - -let dummy_span_id = Int64.min_int - -type span_flavor = - [ `Sync - | `Async - ] - -type t = { - id: span_id; - name: string; - __FUNCTION__: string option; - __FILE__: string; - __LINE__: int; - time_ns: int64; (** Time the span was entered. *) - mutable time_exit_ns: int64; - (** Time the span was exited. Set at exit, [Int64.max_int] otherwise *) - trace_id: trace_id; - tid: int; (** Thread in which span was created *) - parent: parent; - flavor: span_flavor; - params: extension_parameter list; - mutable data: (string * Trace_core.user_data) list; - (** Modified by [add_data_to_span] *) -} -(** The type of spans used by all subscribers. *) diff --git a/src/subscriber/thread_.dummy.ml b/src/subscriber/thread_.dummy.ml deleted file mode 100644 index 29ea74d..0000000 --- a/src/subscriber/thread_.dummy.ml +++ /dev/null @@ -1 +0,0 @@ -let[@inline] get_tid () = 0 diff --git a/src/subscriber/thread_.mli b/src/subscriber/thread_.mli deleted file mode 100644 index 08e8ea1..0000000 --- a/src/subscriber/thread_.mli +++ /dev/null @@ -1,2 +0,0 @@ -val get_tid : unit -> int -(** Get current thread ID *) diff --git a/src/subscriber/thread_.real.ml b/src/subscriber/thread_.real.ml deleted file mode 100644 index 51a172c..0000000 --- a/src/subscriber/thread_.real.ml +++ /dev/null @@ -1 +0,0 @@ -let[@inline] get_tid () = Thread.id @@ Thread.self () diff --git a/src/subscriber/time_.mtime.ml b/src/subscriber/time_.mtime.ml deleted file mode 100644 index baa3f86..0000000 --- a/src/subscriber/time_.mtime.ml +++ /dev/null @@ -1,3 +0,0 @@ -let[@inline] get_time_ns () : int64 = - let t = Mtime_clock.now () in - Mtime.to_uint64_ns t diff --git a/src/subscriber/time_.unix.ml b/src/subscriber/time_.unix.ml deleted file mode 100644 index f7411c1..0000000 --- a/src/subscriber/time_.unix.ml +++ /dev/null @@ -1,3 +0,0 @@ -let[@inline] get_time_ns () : int64 = - let t = Unix.gettimeofday () in - Int64.of_float (t *. 1e9) diff --git a/src/subscriber/trace_subscriber.ml b/src/subscriber/trace_subscriber.ml index 35b864b..e6113bc 100644 --- a/src/subscriber/trace_subscriber.ml +++ b/src/subscriber/trace_subscriber.ml @@ -1,9 +1,6 @@ open Trace_core -module Callbacks = Callbacks -module Subscriber = Subscriber -module Span_sub = Span_sub -type t = Subscriber.t +type t = Collector.t module Private_ = struct let mock = ref false @@ -131,17 +128,3 @@ end (** A collector that calls the callbacks of subscriber *) let collector (self : Subscriber.t) : collector = Collector.C_some (self, coll_cbs) - -module Span_id_generator = struct - type t = int A.t - - let create () = A.make 0 - let[@inline] gen self = A.fetch_and_add self 1 |> Int64.of_int -end - -module Trace_id_generator = struct - type t = int A.t - - let create () = A.make 0 - let[@inline] gen self = A.fetch_and_add self 1 |> Int64.of_int -end