Open Lighting Architecture  Latest Git
Enumerations | Functions | Variables
ola::system Namespace Reference

Detailed Description

System helper functions (Load Average).

Enumerations

enum  load_averages { LOAD_AVERAGE_1_MIN = 0, LOAD_AVERAGE_5_MINS = 1, LOAD_AVERAGE_15_MINS = 2 }
 

Functions

bool GetRLimit (int resource, struct rlimit *lim)
 Get the current values for an rlimit. More...
 
bool SetRLimit (int resource, const struct rlimit &lim)
 Set the values for an rlimit. More...
 
bool LoadAverage (load_averages average, double *value)
 Get the system load average. More...
 

Variables

static const uint8_t NUMBER_LOAD_AVERAGES = 3
 

Function Documentation

◆ GetRLimit()

bool ola::system::GetRLimit ( int  resource,
struct rlimit *  lim 
)

Get the current values for an rlimit.

Parameters
resourcethe rlimit to fetch.
limThe rlimit struct to populate.
Returns
true if the call succeeded, false otherwise.

◆ LoadAverage()

bool ola::system::LoadAverage ( load_averages  average,
double *  value 
)

Get the system load average.

Parameters
[in]averagethe load average to fetch
[out]valuea pointer to where the value will be stored
Returns
true if the requested load average was fetched, false otherwise

◆ SetRLimit()

bool ola::system::SetRLimit ( int  resource,
const struct rlimit &  lim 
)

Set the values for an rlimit.

Parameters
resourcethe rlimit to set.
limThe rlimit struct with the values to set.
Returns
true if the call succeeded, false otherwise.