Linux /proc + /sys parsers rooted at configurable directories so tests can point them at a fake tree. Pure file parsing: compiles (and is unit-testable) everywhere.
More...
#include <system_monitor_detail.hpp>
|
| | LinuxSources (std::string proc_root="/proc", std::string sys_root="/sys", long clock_ticks_per_second=0) |
| |
| RawReading | read () override |
| |
| std::vector< MetricCapability > | capabilities () override |
| |
| std::optional< CpuTimes > | read_system_cpu_times () const |
| | Aggregate "cpu" line of <proc>/stat.
|
| |
| std::optional< double > | read_process_cpu_seconds () const |
| | utime + stime of <proc>/self/stat, in seconds.
|
| |
| std::optional< double > | read_memory_total_bytes () const |
| | MemTotal from <proc>/meminfo, bytes.
|
| |
| std::optional< double > | read_memory_used_bytes () const |
| | MemTotal - MemAvailable from <proc>/meminfo, bytes (nullopt if MemAvailable is absent).
|
| |
| std::optional< double > | read_process_rss_bytes () const |
| | VmRSS from <proc>/self/status, bytes.
|
| |
| std::optional< std::string > | find_cpu_temperature_input () const |
| | The temp*_input file chosen for the CPU temperature, or nullopt.
|
| |
| std::optional< double > | read_cpu_temperature_c () const |
| |
| std::vector< AmdGpuDevice > | find_amd_gpus () const |
| | AMD (PCI vendor 0x1002) DRM cards, skipping connector entries such as card1-DP-1.
|
| |
| GpuSample | read_amd_gpu (const AmdGpuDevice &device, int index) const |
| | Readings of one AMD GPU (index/name/vendor filled, missing files nullopt).
|
| |
| virtual | ~PlatformSources ()=default |
| |
Linux /proc + /sys parsers rooted at configurable directories so tests can point them at a fake tree. Pure file parsing: compiles (and is unit-testable) everywhere.
◆ LinuxSources()
| pulsatrix::detail::LinuxSources::LinuxSources |
( |
std::string |
proc_root = "/proc", |
|
|
std::string |
sys_root = "/sys", |
|
|
long |
clock_ticks_per_second = 0 |
|
) |
| |
|
explicit |
- Parameters
-
| proc_root | Directory standing in for /proc. |
| sys_root | Directory standing in for /sys. |
| clock_ticks_per_second | USER_HZ for /proc/self/stat; 0 = sysconf(_SC_CLK_TCK) on POSIX (100 elsewhere). |
◆ capabilities()
| std::vector< MetricCapability > pulsatrix::detail::LinuxSources::capabilities |
( |
| ) |
|
|
overridevirtual |
◆ find_amd_gpus()
| std::vector< AmdGpuDevice > pulsatrix::detail::LinuxSources::find_amd_gpus |
( |
| ) |
const |
AMD (PCI vendor 0x1002) DRM cards, skipping connector entries such as card1-DP-1.
◆ find_cpu_temperature_input()
| std::optional< std::string > pulsatrix::detail::LinuxSources::find_cpu_temperature_input |
( |
| ) |
const |
The temp*_input file chosen for the CPU temperature, or nullopt.
- Note
- hwmon names in priority order: k10temp, zenpower, coretemp, cpu_thermal, then acpitz (a board/ACPI zone, not the die – last resort). Within the chosen sensor a labelled channel is preferred: Tctl, Tdie, then "Package id *"; else temp1_input.
◆ read()
| RawReading pulsatrix::detail::LinuxSources::read |
( |
| ) |
|
|
overridevirtual |
◆ read_amd_gpu()
Readings of one AMD GPU (index/name/vendor filled, missing files nullopt).
◆ read_cpu_temperature_c()
| std::optional< double > pulsatrix::detail::LinuxSources::read_cpu_temperature_c |
( |
| ) |
const |
◆ read_memory_total_bytes()
| std::optional< double > pulsatrix::detail::LinuxSources::read_memory_total_bytes |
( |
| ) |
const |
MemTotal from <proc>/meminfo, bytes.
◆ read_memory_used_bytes()
| std::optional< double > pulsatrix::detail::LinuxSources::read_memory_used_bytes |
( |
| ) |
const |
MemTotal - MemAvailable from <proc>/meminfo, bytes (nullopt if MemAvailable is absent).
◆ read_process_cpu_seconds()
| std::optional< double > pulsatrix::detail::LinuxSources::read_process_cpu_seconds |
( |
| ) |
const |
utime + stime of <proc>/self/stat, in seconds.
◆ read_process_rss_bytes()
| std::optional< double > pulsatrix::detail::LinuxSources::read_process_rss_bytes |
( |
| ) |
const |
VmRSS from <proc>/self/status, bytes.
◆ read_system_cpu_times()
| std::optional< CpuTimes > pulsatrix::detail::LinuxSources::read_system_cpu_times |
( |
| ) |
const |
Aggregate "cpu" line of <proc>/stat.
The documentation for this class was generated from the following file: