package catapult

  1. Overview
  2. Docs
Tracing system based on the Catapult/TEF format

Install

Dune Dependency

Authors

Maintainers

Sources

v0.1.tar.gz
md5=a7bfa27c3ddd2d29c27173de09293149
sha512=49766ea38c57734918debd6218d95c62f11eb12a6fd3ef5f6a2c60344cea7c274436a46fab1e48abbe0d3f125f31705d2005ab7cae9e56d5f41778c1d2943d65

doc/catapult/Catapult/Tracing/index.html

Module Catapult.TracingSource

Profiling probes.

This is the main API. The user can insert probes into their code, and at runtime, these probes will use the Backend (if present) to emit tracing events to be replayed later. If no backend is present, the probes will do nothing.

Sourcetype backend = (module Catapult__.Backend.S)
Sourcetype arg = [
  1. | `Int of int
  2. | `String of string
  3. | `Float of float
  4. | `Bool of bool
  5. | `Null
]
Sourcetype 'a emit_fun_base = ?cat:string list -> ?pid:int -> ?tid:int -> ?args:(string * arg) list -> string -> 'a

Emitter function, without timestamp. See emit_fun for more details.

Sourcetype 'a emit_fun = ?ts_us:float -> 'a emit_fun_base

An emitter function. The positional string argument is the name.

  • parameter cat

    list of categories for filtering the event

  • parameter pid

    the process ID

  • parameter tid

    the thread ID

  • parameter arguments

    list of arguments for the event, with a name for each

  • parameter ts_us

    timestamp in microseconds

  • parameter name

    the name of this event

Sourcetype 'a with_stack = ?stack:string list -> 'a

Function that can take a stack trace

Sourcetype span_start

Represents the beginning of a span, to emit compact spans

Sourceval null_span : span_start
Sourceval enabled : unit -> bool

Is tracing enabled?

Sourceval emit : (?dur:float -> Event_type.t -> unit) emit_fun with_stack

Emit a generic event.

Sourceval begin_ : unit -> span_start

Emit a "X" event with duration computed from the given span start

Sourceval with_ : ((unit -> 'a) -> 'a) emit_fun_base
Sourceval with1 : (('a -> 'b) -> 'a -> 'b) emit_fun_base
Sourceval with2 : (('a -> 'b -> 'c) -> 'a -> 'b -> 'c) emit_fun_base
Sourceval with3 : (('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd) emit_fun_base
Sourceval begin' : unit emit_fun with_stack

Emit a "B" event

Sourceval exit' : unit emit_fun with_stack

Emit a "E" event

Sourceval span : (dur:float -> unit) emit_fun with_stack

Emit a "X" event

Sourceval obj_new : (id:string -> unit) emit_fun with_stack
Sourceval obj_snap : (snapshot:string -> id:string -> unit) emit_fun with_stack
Sourceval obj_delete : (id:string -> unit) emit_fun with_stack
Sourceval obj_with : (id:string -> (unit -> 'a) -> 'a) emit_fun
Sourceval obj_with1 : (id:string -> ('a -> 'b) -> 'a -> 'b) emit_fun
Sourceval a_begin : (id:string -> unit) emit_fun
Sourceval a_exit : (id:string -> unit) emit_fun
Sourceval a_snap : (id:string -> unit) emit_fun
Sourceval a_with : (id:string -> (unit -> 'a) -> 'a) emit_fun
Sourceval a_with1 : (id:string -> ('a -> 'b) -> 'a -> 'b) emit_fun
Sourceval f_begin : (id:string -> unit) emit_fun
Sourceval f_exit : (id:string -> unit) emit_fun
Sourceval f_step : (id:string -> unit) emit_fun
Sourceval instant : unit emit_fun with_stack
Sourceval counter : (cs:(string * int) list -> unit) emit_fun
Sourceval meta_thread_name : string -> unit
Sourceval meta_process_name : string -> unit
Sourceval tick : unit -> unit

Depending on the tracing backend, this needs to be called regularly to ensure background work is done.

Sourcemodule Syntax : sig ... end
include module type of Syntax
Sourceval (let@) : ('a -> 'b) -> 'a -> 'b
Sourcemodule Control : sig ... end

Controls the current backend.

OCaml

Innovation. Community. Security.