package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
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.