Sys.Linux.Proc.Stat.CpuTimes (Hyper v0.1.0)

Copy Markdown View Source

Cumulative jiffies a CPU (the aggregate, or one core) has spent in each state since boot: user nice system idle iowait irq softirq steal guest guest_nice.

The trailing fields were added across kernel versions (iowait/irq/softirq in 2.6, steal in 2.6.11, guest in 2.6.24, guest_nice in 2.6.33); any column absent on an older kernel defaults to 0.

Summary

Functions

Build from the integer columns of a cpu/cpuN line. Missing trailing columns default to 0; any beyond guest_nice are ignored.

Jiffies spent not doing work: idle + iowait.

Total jiffies across every state - the denominator of a utilization ratio.

Types

t()

@type t() :: %Sys.Linux.Proc.Stat.CpuTimes{
  guest: non_neg_integer(),
  guest_nice: non_neg_integer(),
  idle: non_neg_integer(),
  iowait: non_neg_integer(),
  irq: non_neg_integer(),
  nice: non_neg_integer(),
  softirq: non_neg_integer(),
  steal: non_neg_integer(),
  system: non_neg_integer(),
  user: non_neg_integer()
}

Functions

from_columns(values)

@spec from_columns([non_neg_integer()]) :: t()

Build from the integer columns of a cpu/cpuN line. Missing trailing columns default to 0; any beyond guest_nice are ignored.

idle(cpu_times)

@spec idle(t()) :: non_neg_integer() | float()

Jiffies spent not doing work: idle + iowait.

total(times)

@spec total(t()) :: non_neg_integer() | float()

Total jiffies across every state - the denominator of a utilization ratio.