Aria
2.8.0
|
Utility to get statistics about the host operating system (CPU usage, wireless link data, etc). More...
#include <ArSystemStatus.h>
Static Public Member Functions | |
static double | getCPU () |
Get CPU work to idle ratio since last refresh. More... | |
static double | getCPUPercent () |
Get CPU usage as percentage since last refresh. More... | |
static std::string | getCPUPercentAsString () |
Get CPU percentage in a string. | |
static ArRetFunctor< double > * | getCPUPercentFunctor () |
static unsigned long | getProgramUptime () |
Get program's uptime (seconds) | |
static ArRetFunctor< unsigned long > * | getProgramUptimeFunctor () |
static unsigned long | getUptime () |
Get total system uptime (seconds) | |
static ArRetFunctor< unsigned long > * | getUptimeFunctor () |
static double | getUptimeHours () |
Get total system uptime (hours) | |
static std::string | getUptimeHoursAsString () |
Get total system uptime in a string (hours) | |
static ArRetFunctor< double > * | getUptimeHoursFunctor () |
static int | getWirelessDiscardedPackets () |
Get wireless network total discarded packets (for first configured wireless device). More... | |
static int | getWirelessDiscardedPacketsBecauseNetConflict () |
Get wireless network packets discarded because of a conflict with another network (for first configured wireless device). More... | |
static int | getWirelessLinkNoise () |
Get wireless network noise level (for first configured wireless device). More... | |
static ArRetFunctor< int > * | getWirelessLinkNoiseFunctor () |
static int | getWirelessLinkQuality () |
Get wireless network general link quality heuristic (for first configured wireless device). More... | |
static ArRetFunctor< int > * | getWirelessLinkQualityFunctor () |
static int | getWirelessLinkSignal () |
Get wireless netork signal level (for first configured wireless device). More... | |
static ArRetFunctor< int > * | getWirelessLinkSignalFunctor () |
static void | invalidate () |
static void | refresh () |
static void | runRefreshThread (int refreshFrequency=5000) |
static void | startPeriodicUpdate (int refreshFrequency=5000, ArLog::LogLevel logLevel=ArLog::Verbose) |
Create a new thread which periodically invalidates cached data, causing it to be recalculated when next accessed. More... | |
static void | stopPeriodicUpdate () |
Stop periodic update thread. More... | |
Utility to get statistics about the host operating system (CPU usage, wireless link data, etc).
Normally, calling any accessor to read a value will query the operating system to get the most recent value. However, if you will be accessing data very frequently and want those calls to be faster, you can start a thread by calling startPeriodicUpdate() which will periodically query new values from the operating system and cache them for accessors to return.
This class is only implemented for Linux; on Windows you will get invalid information.
|
static |
Get CPU work to idle ratio since last refresh.
This is a value ranging from (0 .. 1) X (Num. CPUs). (Therefore if you have two CPUs, the maximum value will be 2.0, or 200%.) This value is calculated as the percentage of time the CPU spent doing work (not in "idle" state) since the previous calculation.
|
static |
Get CPU usage as percentage since last refresh.
This is a value ranging from (0..100) X (Num. CPUs). (Therefore if you have two CPUs, the maximum value will be 200%).
|
static |
|
static |
|
static |
|
static |
|
static |
Get wireless network total discarded packets (for first configured wireless device).
|
static |
Get wireless network packets discarded because of a conflict with another network (for first configured wireless device).
|
static |
Get wireless network noise level (for first configured wireless device).
|
static |
Get wireless network general link quality heuristic (for first configured wireless device).
|
static |
Get wireless netork signal level (for first configured wireless device).
|
inlinestatic |
|
inlinestatic |
|
static |
Create a new thread which periodically invalidates cached data, causing it to be recalculated when next accessed.
INTERNAL_CLASSES.
Starting this thread is optional; start it if you will be accessing the data frequently, so that is doesn't need to be re-read and re-calculated on each access. If you will only be accessing the data occasionally, you do not need to start the update thread, it will be updated each time you read a value.
|
static |
Stop periodic update thread.
Henceforth any access of data will cause it to be re-read and recalculated.