lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
lintel::ProcessResourceReader Class Reference

#include <ProcessResourceReader.h>

Public Member Functions

 ProcessResourceReader ()=delete
 

Static Public Member Functions

static ProcessResourceData readOf (ProcessId pid, const std::optional< ProcessResourceData > &previous)
 

Detailed Description

Reads per-process resource usage. Supports Linux (/proc) and macOS (libproc). On other platforms all values are reported as invalid (no resource data). Pass the previously returned snapshot into the next call to compute a CPU percentage delta.

Constructor & Destructor Documentation

◆ ProcessResourceReader()

lintel::ProcessResourceReader::ProcessResourceReader ( )
delete

Member Function Documentation

◆ readOf()

static ProcessResourceData lintel::ProcessResourceReader::readOf ( ProcessId  pid,
const std::optional< ProcessResourceData > &  previous 
)
static

Read the current resource snapshot for the given process.

Parameters
pidthe operating system process id
previousa previously read snapshot used to compute the CPU delta
Returns
the resource snapshot (valid=false on unsupported platforms or unreadable pid)

The documentation for this class was generated from the following file: