Irmin_traces.Trace_stat_summary_utils
Utilities to summarise data.
This file is NOT meant to be used from Tezos, as opposed to some other "trace_*" files.
val histo_t : histo Repr.t
val curve_t : curve Repr.t
snap_to_integer ~significant_digits v
is Float.round v
if v
is close to Float.round v
, otherwise the result is v
. significant_digits
defines how close things are.
Examples:
When significant_digits
is 4
and v
is 42.00001
, snap_to_integer v
is 42.
.
When significant_digits
is 4
and v
is 42.001
, snap_to_integer v
is v
.
val create_pp_real :
?significant_digits:int ->
float list ->
Stdlib.Format.formatter ->
float ->
unit
create_pp_real examples
is pp_real
, a float pretty-printer that adapts to the examples
shown to it.
It is highly recommended, but not mandatory, for all the numbers passed to pp_real
to be included in examples
.
When all the examples
are integers, the display may be different. The examples that aren't integer, but that are very close to be a integers are counted as integers. significant_digits
is used internally to snap the examples to integers.
create_pp_seconds examples
is pp_seconds
, a time span pretty-printer that adapts to the examples
shown to it.
It is highly recommended, but not mandatory, for all the numbers passed to pp_seconds
to be included in examples
.
Pretty prints a percent in a way that always takes 4 chars.
Examples: 0.
is " 0%"
, 0.00001
is "0.0%"
, 0.003
is "0.3%"
, 0.15
is " 15%"
, 9.0
is 900%
, 700.
is 700x
, 410_000.0
is "4e6x"
and 1e100
is "++++"
.
Negative inputs are undefined.
module Exponential_moving_average : sig ... end
Functional Exponential Moving Average (EMA).
module Resample : sig ... end
This Resample
module offers 3 ways to resample a 1d vector:
module Variable_summary : sig ... end
Functional summary for a variable that has zero or more occurences per period. accumulate
is expected to be called in_period_count
times before finalise
is.
module Parallel_folders : sig ... end
See Trace_stat_summary
for an explanation and an example.