package rocq-runtime

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module NewProfileSource

Sourcemodule MiniJson : sig ... end
Sourcemodule Counters : sig ... end
Sourceval profile : string -> ?args:(unit -> (string * MiniJson.t) list) -> (unit -> 'a) -> unit -> 'a

Profile the given function.

args is called only if profiling is active, it is used to produce additional annotations.

Sourceval is_profiling : unit -> bool
Sourcetype settings = {
  1. output : Format.formatter;
  2. fname : string;
}
Sourceval init : settings -> unit

Profiling must not be active. Activates profiling with a fresh state.

Sourceval finish : unit -> unit

Profiling must be active. Deactivates profiling.

Sourcetype accu

Profiling state accumulator.

Sourceval pause : unit -> accu option

Returns None if profiling is inactive. Deactivates profiling if it is active, returning the current state.

Sourceval resume : accu -> unit

Profiling must not be active. Activates profiling with the given state.

Sourcetype sums = (float * int) CString.Map.t

Timings for sub-events: for each event, how long it took and how many times it was called.

Sourceval empty_sums : sums
Sourceval sums_union : sums -> sums -> sums
Sourceval with_profiling : (unit -> 'a) -> MiniJson.t list * sums * 'a

Runs the given function with profiling active and returns the produced events and sum times of subevents.

Sourceval insert_results : MiniJson.t list -> sums -> unit

Profiling must be active. Outputs the given events and includes the sum times in the current event.

Sourceval pptime : Format.formatter -> float -> unit

Pretty print a time given in seconds using smaller units as needed.

Custom outputs

Sourceval format_header : Format.formatter -> unit

Output header for profile files

Output footer for profile files and flushes the formatter.

OCaml

Innovation. Community. Security.