package pyro-caml-instruments

  1. Overview
  2. Docs
Pyroscope + OCaml = Pyro Caml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.0.0.tar.gz
md5=22cc6fd089dd4ecb8cb41581d3d109e3
sha512=9c5fd425c5981e31dbcdcbaef6f8f462f749d165df08e1686ec2e44872dca590b5a137d3aea76b2799de7f0eb5615fe03823bdf290bde68100dfa931260a40e5

doc/pyro-caml-instruments/Pyro_caml_instruments/index.html

Module Pyro_caml_instrumentsSource

Sourceval with_memprof_sampler : ?sampling_rate:float -> (unit -> 'a) -> 'a

with_memprof_sampler ?sampling_rate f enables the Pyro Caml sampler for the duration of f. An optional sampling_rate can be passed which will be given to the underlying Gc.Memprof profiler. By default it is 1e-6, but choose a higher value such as 1e-4 if there the profiler sample rate is high, or not many allocations happen in your program. Alternatively if not many allocations happen, use emit_point_event or the Pyro Caml PPX

Sourceval maybe_with_memprof_sampler : ?sampling_rate:float -> (unit -> 'a) -> 'a

maybe_with_memprof_sampler ?sampling_rate f is similar to with_memprof_sampler except it only enables the sampler if the env var OCAML_RUNTIME_EVENTS_START is set

Sourceval emit_point_event : Printexc.raw_backtrace -> unit

emit_point_event (Printexc.get_callstack max_int) will record a stack trace to the profiler. This is useful if you are in code that might not allocate much and you want to ensure you're still generating enough sample points.

Sourceval create_cursor : string -> int -> Runtime_events.cursor

create_cursor path pid creates a cursor for reading runtime events from the given path and pid.

Sourceval read_poll : ?max_events:int option -> Runtime_events.cursor -> float -> Pyro_caml_instruments__.Stack_trace.t list

read_poll cursor sample_interval will read the profiling runtime events from the given cursor, and will give attempt to give a single Stack_trace.t per every unique thread id, within sample_interval of the start time of this function call. If a sample is not within this interval, it will not be considered. Additionally it also ensures the samples chosen are those closest to the start of the call of this function.