package xapi-rrd

  1. Overview
  2. Docs

Module Rrd_fringSource

Ring structures for RRAs The values in the structures are bound to a range

Sourcemodule BoundedFloat = Rrd_utils.BoundedFloat
Sourcetype t
Sourceval make : int -> float -> float -> float -> t

create a ring structure with size record; records initialised to init

  • parameter size

    number of elements the ring holds (constant)

  • parameter init

    value all the elements are initialized to

Sourceval copy : t -> t

create a duplicate ring structure

Sourceval length : t -> int

length (size) of the ring, it is constant

Sourceval push : t -> float -> unit

push into the ring one element

Sourceval peek : t -> int -> float

get the ith old element from the ring

Sourceval top : t -> float

get the top element of the ring

Sourceval iter_nb : t -> (float -> unit) -> int -> unit

iterate over nb element of the ring, starting from the top

Sourceval raw_iter : t -> (float -> unit) -> unit
Sourceval iter : t -> (float -> unit) -> unit

iterate over all elements of the ring, starting from the top

Sourceval get_nb : t -> int -> float array

get array of latest nb value

Sourceval get : t -> float array

get an array with all the values in the ring

OCaml

Innovation. Community. Security.