ProcessorsDetector class

Does the work for Processors. Not exported from dox_core. The parsers take file text, so tests can call them without real files.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

detect({required ProcFileReader reader, required int numberOfProcessors, required bool isLinux}) → int
Works out the usable CPUs from the files the reader gives. Tests pass a fake reader.
parseCgroupV1(String? quota, String? period) → int?
Reads cgroup v1 cpu.cfs_quota_us and cpu.cfs_period_us. A quota of -1 means no limit. Returns null on no limit or bad text.
parseCgroupV2(String? text) → int?
Reads cgroup v2 cpu.max: max 100000 (no limit) or 400000 100000. Returns null when there is no limit or the text is bad.
parseCpuList(String list) → int?
Counts the CPUs in a list like 0-3,8,10-11. Empty parts are skipped. Returns null on bad input.
parseCpusAllowed(String? status) → int?
Reads the Cpus_allowed_list: line of /proc/self/status. The list looks like 0-3,8,10-11. Returns null on bad input.