package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-libs.base/Tezos_base/Profiler/index.html
Module Tezos_base.Profiler
Source
This profiling library declares a high-level interface meant to be used to instrument code in order to measure the time spent in the different parts in such a way to yield a (human-)processable report. This module declares a generic interface (driver) that will provide an API to the developer to instrument the code. When the profiling data is recorded, the abstracted profiler will feed it to its "plugged" backend (instance) which will process the different profiler's nodes in order to produce the reports. Reports may also be combined to interwine different components' traces.
The provided API is intentionally simplistic to simplify its usage. The basic usage is to call record <symbol>
before the desired section to profile and stop ()
when we exit it. Nested calls are also supported and, given that the backend supports it, will be displayed as a callgraph. The API is also augmented with higher-level combinators in order to avoid mismatched stop
s and to support Lwt
function calls.
type time = {
wall : float;
(*Wall-clock time: total time elapsed.
*)cpu : float;
(*CPU time: time elapsed in the CPU.
*)
}
The level of detail of report sections. The driver can choose to use this information to skip or aggregate sections below a given level. The driver could also record everything, including the level of detail, and let a post processor skip or aggregate at display time.
type aggregated_node = {
count : int;
total : span;
children : aggregated_node StringMap.t;
node_lod : lod;
}
An aggregate node registers multiple calls to a section and sum their occurences and time. It also recursively aggregate its sub-aggregation nodes.
A sequence item registers one section with potential sub-reports and registers elapsed-time.