|
| | process_metrics (std::optional< pid_type > pid=std::nullopt) |
| | Construct metrics for a target process.
|
| |
| pid_type | pid () const noexcept |
| | Get the PID associated with this instance.
|
| |
| void | sample () |
| | Take a new CPU usage sample for the target PID.
|
| |
| double | cpu_percent_total_capacity () const |
| | CPU usage as percentage of total machine capacity.
|
| |
| double | cpu_percent_per_core () const |
| | CPU usage scaled per logical core.
|
| |
| std::uint32_t | thread_count () const |
| | Get instantaneous number of threads in the target process.
|
| |
| std::uint64_t | ram_bytes () const |
| | Get resident memory usage (RSS / working set) in bytes.
|
| |
| std::uint32_t | cpu_count () const |
| | Get number of logical CPUs detected on the system.
|
| |
Read-only process resource metrics for a given PID.
Provides the following metrics for a target process:
- number of threads
- resident memory (RSS / working set)
- CPU load (relative to total machine capacity and per-core scale)
- Note
- For macOS, querying other PIDs may require elevated privileges (task_for_pid entitlement/root); otherwise metrics may be unavailable.
Definition at line 54 of file pm.hpp.