Skip to content

readCpuFrequencyRatio

readCpuFrequencyRatio(sysfsRoot?): Promise<number | null>

Defined in: packages/app-system/src/os/host-metrics.ts:22

Mean of scaling_cur_freq / cpuinfo_max_freq across the cores exposing both, or null where the platform exposes neither — which a caller must read as “unknown”, never as “nominal”.

A ratio well below 1 during a measurement means the CPU is being clocked down, which invalidates a comparison against samples taken at full speed.

Only Linux publishes these nodes, so every other platform answers null by simply finding nothing to read.

string

Root of the sysfs mount. Defaults to /sys.

Promise<number | null>