artdaq_utilities
v1_05_11a
|
Collects metrics from the system, using proc filesystem or kernel API calls More...
#include <artdaq-utilities/Plugins/SystemMetricCollector.hh>
Public Member Functions | |
SystemMetricCollector (bool processMetrics, bool systemMetrics) | |
SystemMetricCollector Constructor More... | |
void | GetSystemCPUUsage () |
Calculate the system CPU usage percentages More... | |
double | GetProcessCPUUsagePercent () |
Return the current amount of CPU usage for the current process, % More... | |
uint64_t | GetAvailableRAM () |
Get the amount of available RAM in the system More... | |
uint64_t | GetBufferedRAM () |
Get the amount of RAM currently being used for cache More... | |
uint64_t | GetTotalRAM () |
Get the total amount of RAM in the system More... | |
double | GetAvailableRAMPercent (bool buffers) |
Get the percentage of available RAM More... | |
uint64_t | GetProcessMemUsage () |
Get the amount of RAM being used by this process More... | |
double | GetProcessMemUsagePercent () |
Get the amount of RAM being used by this process More... | |
uint64_t | GetNetworkReceiveBytes (std::string ifname) |
Get the amount of data received from the network in the last network collection interval (1.0 s) More... | |
uint64_t | GetNetworkSendBytes (std::string ifname) |
Get the amount of data sent to the network in the last network collection interval (1.0 s) More... | |
uint64_t | GetNetworkReceiveErrors (std::string ifname) |
Get the number of network receive errors in the last network collection interval (1.0 s) More... | |
uint64_t | GetNetworkSendErrors (std::string ifname) |
Get the number of network send errors in the last network collection interval (1.0 s) More... | |
uint64_t | GetNetworkTCPRetransSegs () |
Return the current number of TCP (total) segments retransmitted, segments More... | |
std::list< std::string > | GetNetworkInterfaceNames () |
std::list< std::unique_ptr < MetricData > > | SendMetrics () |
Send the configured metrics More... | |
Collects metrics from the system, using proc filesystem or kernel API calls
Definition at line 12 of file SystemMetricCollector.hh.
artdaq::SystemMetricCollector::SystemMetricCollector | ( | bool | processMetrics, |
bool | systemMetrics | ||
) |
SystemMetricCollector Constructor
processMetrics | Whether to collect process-level metrics (i.e. process CPU/RAM) |
systemMetrics | Whether to collect system-level metrics (i.e. System CPU/RAM/Network) |
Definition at line 16 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetAvailableRAM | ( | ) |
Get the amount of available RAM in the system
Definition at line 83 of file SystemMetricCollector.cc.
double artdaq::SystemMetricCollector::GetAvailableRAMPercent | ( | bool | buffers | ) |
Get the percentage of available RAM
buffers | Whether cache RAM should be counted as available |
Definition at line 116 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetBufferedRAM | ( | ) |
Get the amount of RAM currently being used for cache
Definition at line 94 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetNetworkReceiveBytes | ( | std::string | ifname | ) |
Get the amount of data received from the network in the last network collection interval (1.0 s)
ifname | Name of the interface to collect |
Definition at line 145 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetNetworkReceiveErrors | ( | std::string | ifname | ) |
Get the number of network receive errors in the last network collection interval (1.0 s)
ifname | Name of the interface to collect |
Definition at line 157 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetNetworkSendBytes | ( | std::string | ifname | ) |
Get the amount of data sent to the network in the last network collection interval (1.0 s)
ifname | Name of the interface to collect |
Definition at line 151 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetNetworkSendErrors | ( | std::string | ifname | ) |
Get the number of network send errors in the last network collection interval (1.0 s)
ifname | Name of the interface to collect |
Definition at line 195 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetNetworkTCPRetransSegs | ( | ) |
Return the current number of TCP (total) segments retransmitted, segments
Definition at line 163 of file SystemMetricCollector.cc.
double artdaq::SystemMetricCollector::GetProcessCPUUsagePercent | ( | ) |
Return the current amount of CPU usage for the current process, %
Definition at line 62 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetProcessMemUsage | ( | ) |
Get the amount of RAM being used by this process
Definition at line 128 of file SystemMetricCollector.cc.
double artdaq::SystemMetricCollector::GetProcessMemUsagePercent | ( | ) |
Get the amount of RAM being used by this process
Definition at line 137 of file SystemMetricCollector.cc.
void artdaq::SystemMetricCollector::GetSystemCPUUsage | ( | ) |
Calculate the system CPU usage percentages
Definition at line 36 of file SystemMetricCollector.cc.
uint64_t artdaq::SystemMetricCollector::GetTotalRAM | ( | ) |
Get the total amount of RAM in the system
Definition at line 105 of file SystemMetricCollector.cc.
std::list< std::unique_ptr< artdaq::MetricData > > artdaq::SystemMetricCollector::SendMetrics | ( | ) |
Send the configured metrics
Definition at line 211 of file SystemMetricCollector.cc.