package irmin-bench

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

Utilities to summarise data.

This file is NOT meant to be used from Tezos, as opposed to some other "trace_*" files.

type histo = (float * int) list
val histo_t : histo Repr.t
type curve = float list
val curve_t : curve Repr.t
val snap_to_integer : significant_digits:int -> float -> float

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 -> 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.

val create_pp_seconds : float list -> Format.formatter -> float -> unit

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.

val pp_percent : Format.formatter -> float -> unit

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.

val approx_transaction_count_of_block_count : ?first_block_idx:int -> int -> int
val approx_operation_count_of_block_count : ?first_block_idx:int -> int -> int
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.

OCaml

Innovation. Community. Security.