Skip to content

Commit 11737fd

Browse files
committed
Adapt README to process monitor and default tags
1 parent 032beeb commit 11737fd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ The derived value is generated only from the first value of the metric and it is
137137
See how it works in the example: [examples/4-RateDerivedMetric.cxx](examples/4-RateDerivedMetric.cxx).
138138
139139
### Global tags
140-
Global tags are added to each metric sent using given monitoring instance. Two tags: `hostname` and `name` (process name) are set as global by default.
140+
Global tags are added to each metric sent using given monitoring instance. `hostname` is set as global by default.
141141
142142
You can add your own global tag by calling `addGlobalTag(std::string_view key, std::string_view value)` or `addGlobalTag(tags::Key, tags::Value)`.
143143
@@ -148,10 +148,10 @@ This feature provides basic performance status of the process. Note that is runs
148148
```cpp
149149
enableProcessMonitoring([interval in seconds]);
150150
```
151-
The following metrics are generated every interval:
152-
+ **cpuUsedPercentage** - percentage of a core usage over time interval
153-
+ **involuntaryContextSwitches** - involuntary context switches over time interval
154-
+ **memoryUsagePercentage** - ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage (Linux only)
151+
The `processPerformance` metric is generated every interval with following values:
152+
+ **cpu_used_pct** - percentage of a core usage over time interval
153+
+ **involuntary_context_switches** - involuntary context switches over time interval
154+
+ **memory_used_pct** - ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage (Linux only)
155155

156156
### StdOut backend output format
157157
```

src/ProcessMonitor.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Metric ProcessMonitor::getCpuAndContexts()
7777
double fractionCpuUsed = (currentUsage.ru_utime.tv_sec * 1000000.0 + currentUsage.ru_utime.tv_usec - (mPreviousGetrUsage.ru_utime.tv_sec * 1000000.0 + mPreviousGetrUsage.ru_utime.tv_usec) + currentUsage.ru_stime.tv_sec * 1000000.0 + currentUsage.ru_stime.tv_usec - (mPreviousGetrUsage.ru_stime.tv_sec * 1000000.0 + mPreviousGetrUsage.ru_stime.tv_usec)) / timePassed;
7878

7979
Metric metric{"processPerformance"};
80-
metric.addValue(static_cast<double>(std::round(fractionCpuUsed * 100.0 * 100.0) / 100.0), "cpu_user_pct");
80+
metric.addValue(static_cast<double>(std::round(fractionCpuUsed * 100.0 * 100.0) / 100.0), "cpu_used_pct");
8181
metric.addValue(static_cast<uint64_t>(currentUsage.ru_nivcsw - mPreviousGetrUsage.ru_nivcsw), "involuntary_context_switches");
8282

8383
mTimeLastRun = timeNow;

0 commit comments

Comments
 (0)