package magic-trace

  1. Overview
  2. Docs
Collects and displays high-resolution traces of what a process is doing

Install

Dune Dependency

Authors

Maintainers

Sources

v1.0.1.tar.gz
sha256=77b2e4b3bc769910656d0fdee4839250548aa49486fd3554f6c057f1d64abe99
sha512=1f111db6348673c22a110611182a92c8aa999668dc077c44bc4abcaa72ccb197899ff2577047888627b50fcc9890824de6c82b4fe9f06129190b8b487ec3f716

doc/magic-trace.magic_trace/Magic_trace/Min_duration/index.html

Module Magic_trace.Min_durationSource

Intended for use like so:

  let min_dur = Magic_trace.Min_duration.of_ns 3_000

  let my_fun a b c =
    Magic_trace.mark_start ();
    (* ... *)
    if Magic_trace.Min_duration.over min_dur then Magic_trace.take_snapshot ()
  ;;

which allows capturing only unusually long executions without adding the ~10us breakpoint overhead on every run while magic-trace is attached.

See also the -duration-thresh flag for use in combination with this or instead of it if you can tolerate a 10us pause on every call.

Sourcetype t
Sourceval of_ns : int -> t

This involves using and forcing Time_stamp_counter.calibrator so should probably be done only once at the top level as opposed to every time.

Sourceval over : t -> bool

Returns true if the time since mark_start is over the threshold

OCaml

Innovation. Community. Security.