package octez-internal-libs

  1. Overview
  2. Docs
A package that contains some libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-internal-libs.irmin/Irmin/Metrics/index.html

Module Irmin.MetricsSource

Type agnostics mechanisms to manipulate metrics.

Metrics defines primitives to handle metrics inside of Irmin. Its purpose is to decouple the metrics type definition from the data manipulation.

A t can be modified in different ways, depending on the update_mode.

Sourcetype origin = ..

An extensible type to get the location of the definition.

Sourcetype 'a t

t is the object that describes how a t is gathered and store. The 'a parameter represents the type of the internal data.

Sourceval state : 'a t -> 'a

The internal state extracted from a t.

Sourceval set_state : 'a t -> 'a -> unit

set_state m v updates the value in the t object.

Sourcetype 'a update_mode =
  1. | Mutate of 'a -> unit
  2. | Replace of 'a -> 'a

update_mode describes how the data will be handled by the update function.

  • Mutate: the value and the storage are not modified but the content of the value can be mutate.
  • Replace f: apply f to the value and updates its content.

It gives the possibility to handle the same metric in different ways.

Sourceval v : ?origin:origin -> name:string -> initial_state:'a -> 'a Repr.ty -> 'a t

v ~origin ~name ~initial_state repr create a new t. The origin can be set to give an hint about where the data are gathered. name is a name to describe this metrics. initial_state is the first value to store in the metric object. repr describes the type representation to allow serialization.

Sourceval update : 'a t -> 'a update_mode -> unit

update metrics mode updates the metric by taking in consideration mode to define how it acts on t according to their specication.

OCaml

Innovation. Community. Security.