Computes and publishes general process metrics. More...
#include <MetricsProcess.h>
Public Member Functions | |
MetricsProcess () | |
Constructor. More... | |
void | collect (int64_t now, MetricsCollector *collector) override |
Collects process metrics. More... | |
Private Attributes | |
int64_t | m_last_timestamp {} |
Last collection timestamp in nanoseconds. More... | |
int64_t | m_last_sys {} |
Last recorded CPU system time. More... | |
int64_t | m_last_user {} |
Last recorded CPU user time. More... | |
Computes and publishes general process metrics.
Definition at line 41 of file MetricsProcess.h.
MetricsProcess::MetricsProcess | ( | ) |
Constructor.
Initializes m_last_sys and m_last_user from data gathered from SIGAR. Initializes m_last_timestamp to current time in milliseconds.
Definition at line 39 of file MetricsProcess.cc.
|
overridevirtual |
Collects process metrics.
Computes process metrics and publishes them via collector
. The following JVM metrics and process metrics collected from SIGAR are computed and published:
cpu.sys
- CPU system time (%) cpu.user
- CPU user time (%) memory.virtual
- Virtual memory (GB) memory.resident
- Resident memory (GB) memory.heap
- Heap size (GB) memory.heapSlack
- Heap slack bytes (GB) version
- Hypertable version string now | Current time in nanoseconds |
collector | Metrics collector |
Implements Hypertable::Metrics.
Definition at line 47 of file MetricsProcess.cc.
|
private |
Last recorded CPU system time.
Definition at line 72 of file MetricsProcess.h.
|
private |
Last collection timestamp in nanoseconds.
Definition at line 69 of file MetricsProcess.h.
|
private |
Last recorded CPU user time.
Definition at line 75 of file MetricsProcess.h.