Crate kstat_rs

source ·
Expand description

Rust library for interfacing with illumos kernel statistics, libkstat.

The illumos kstat system is a kernel module for exporting data about the system to user processes. Users create a control handle to the system with Ctl::new, which gives them access to the statistics exported by their system.

Individual statistics are represented by the Kstat type, which includes information about the type of data, when it was created or last updated, and the actual data itself. The Ctl handle maintains a linked list of Kstat objects, which users may walk with the Ctl::iter method.

Each kstat is identified by a module, an instance number, and a name. In addition, the data may be of several different types, such as name/value pairs or interrupt statistics. These types are captured by the Data enum, which can be read and returned by using the Ctl::read method.

Structs

  • Ctl is a handle to the kstat library.
  • Interrupt kernel statistic.
  • An I/O kernel statistic
  • Kstat represents a single kernel statistic.
  • A name/value data element from a named kernel statistic.
  • A timer kernel statistic.

Enums

  • Data from a single kstat.
  • Kinds of errors returned by the library.
  • The value part of a name-value kernel statistic.
  • The data type of a single name/value pair of a named kstat.
  • The type of a kstat.