CPU Time - System

What it does

This metric provider reads the total time spent in the CPU based on the system /proc/stat file.

Classname

  • CpuTimeSystemProvider

Input Parameters

  • args
    • -i: interval in milliseconds

By default the measurement interval is 100 ms.

> ./metric-provider-binary -i 100

Output

This metric provider prints to Stdout a continuous stream of data. The format of the data is as follows:

TIMESTAMP READING CONTAINER-ID

Where:

  • TIMESTAMP: Unix timestamp, in microseconds
  • READING:The time spent, in microseconds, by this container in the CPU
  • CONTAINER-ID: The container ID that this reading is for

Any errors are printed to Stderr.

How it works

The provider reads from /proc/stat. We collect user, nice, system, idle iowait, irq, softirq, steal (see definitions here), and add them together over the measurement period.