Module Baking_profiler.Baker_profiler

type nonrec metadata = Tezos_profiler.Profiler.metadata
type nonrec ids = Tezos_profiler.Profiler.ids
type nonrec verbosity = Tezos_profiler.Profiler.verbosity =
  1. | Notice
  2. | Info
  3. | Debug

Plugging

plug instance plugs the profiler stored in the module to instance

unplug instance unplugs the profiler stored in the module from instance

val close_and_unplug : Tezos_profiler.Profiler.instance -> unit

close_and_unplug instance closes the profiler stored in the module and unplugs it from instance

val close_and_unplug_all : unit -> unit

close_and_unplug_all () closes the profiler stored in the module and unplugs it from all instances it was plugged to

val plugged : unit -> Tezos_profiler.Profiler.instance list

plugged () returns all the instances plugged to the profiler stored in the module

Sequences

val record : cpu:bool option -> verbosity -> id -> unit

Open a sequence in the current sequence. If currently aggregating (not all aggregation scopes are closed), this has the same semantics as aggregate instead.

val aggregate : cpu:bool option -> verbosity -> id -> unit

Open an aggregation node in the current sequence.

val stop : unit -> unit

Close the most recently opened sequence or aggregation scope.

Profiling

val stamp : cpu:bool option -> verbosity -> id -> unit

Record a timestamp in the most recently opened sequence.

val mark : verbosity -> ids -> unit

Count this event's occurences in the most recent sequence.

val span : cpu:bool option -> verbosity -> Tezos_profiler.Profiler.span -> ids -> unit

Sum the time spent in this event in the most recent sequence.

Include a report in the current sequence.

val record_f : cpu:bool option -> verbosity -> id -> (unit -> 'a) -> 'a

record_f verbosity label f will call:

  record verbosity name;
  f ();
  stop ();
val record_s : cpu:bool option -> verbosity -> id -> (unit -> 'a Lwt.t) -> 'a Lwt.t

Same as record_f but for Lwt function

val aggregate_f : cpu:bool option -> verbosity -> id -> (unit -> 'a) -> 'a

aggregate_f verbosity label f will call:

  aggregate verbosity name;
  f ();
  stop ();
val aggregate_s : cpu:bool option -> verbosity -> id -> (unit -> 'a Lwt.t) -> 'a Lwt.t

Same as aggregate_f but for Lwt functions

val span_f : cpu:bool option -> verbosity -> ids -> (unit -> 'a) -> 'a

span_f verbosity label_list f will compute span but specifically around f

val span_s : cpu:bool option -> verbosity -> ids -> (unit -> 'a Lwt.t) -> 'a Lwt.t

Same as span_f but for Lwt functions