Module Mkernel.StatsSource

Statistics (counters) about devices and malloc.

Sourcetype t

The type of statistics of a device.

Sourcetype handle

The type of device handle, used for stats.

Sourceval rx_ops : t -> int

rx_ops stats are the number of read operations of stats.

Sourceval rx_bytes : t -> int

rx_bytes stats are the number of read bytes of stats.

Sourceval tx_ops : t -> int

tx_ops stats are the number of write operations of stats.

Sourceval tx_bytes : t -> int

tx_bytes stats are the number of write bytes of stats.

Sourceval devices : unit -> (handle * string * string) list

all_devices () are the statistics sources for all devices (a triple of handle, name, type).

Sourceval from : handle -> t

from handle is the statistics of the device handle.

Sourcetype malloc = {
  1. heap_words : int;
    (*

    total number of words allocatable on the heap.

    *)
  2. live_words : int;
    (*

    number of allocated words on the heap.

    *)
  3. stack_words : int;
    (*

    number of words used by the program stack.

    *)
  4. free_words : int;
    (*

    number of free words on the heap.

    *)
}

The type about memory usage as observed by malloc.

Sourceval malloc : ?quick:bool -> unit -> malloc

malloc ~quick () returns memory allocation statistics. If quick is provided and true (the default), it uses a pre-computed value. If quick is false the function mallinfo is used, which traverse the entire heap, and is thus more expensive and more accurate.