package xapi-rrd

  1. Overview
  2. Docs

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

module BoundedFloat = Rrd_utils.BoundedFloat
type t
val 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

val copy : t -> t

create a duplicate ring structure

val length : t -> int

length (size) of the ring, it is constant

val push : t -> float -> unit

push into the ring one element

val peek : t -> int -> float

get the ith old element from the ring

val top : t -> float

get the top element of the ring

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

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

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

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

val get_nb : t -> int -> float array

get array of latest nb value

val get : t -> float array

get an array with all the values in the ring


Innovation. Community. Security.