diff options
author | Daniel Hodges <hodges@uber.com> | 2020-02-20 05:36:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 11:36:33 +0100 |
commit | ec6214138801d80045e916479a1f8297c40de8e3 (patch) | |
tree | c71787ad5060284be50ebce5e6445d587304ddeb /README.md | |
parent | b40954dce598577413d93ce32cc005b57c6371bb (diff) | |
download | prometheus_node_collector-ec6214138801d80045e916479a1f8297c40de8e3.tar.bz2 prometheus_node_collector-ec6214138801d80045e916479a1f8297c40de8e3.tar.xz prometheus_node_collector-ec6214138801d80045e916479a1f8297c40de8e3.zip |
Fix num cpu (#1561)
* add a map of profilers to CPUids
`runtime.NumCPU()` returns the number of CPUs that the process can run
on. This number does not necessarily correlate to CPU ids if the
affinity mask of the process is set.
This change maintains the current behavior as default, but also allows
the user to specify a range of CPUids to use instead.
The CPU id is stored as the value of a map keyed on the profiler
object's address.
Signed-off-by: Joe Damato <jdamato@fastly.com>
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
Signed-off-by: Daniel Hodges <hodges@uber.com>
Co-authored-by: jdamato-fsly <55214354+jdamato-fsly@users.noreply.github.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -84,6 +84,18 @@ Depending on the configured value different metrics will be available, for most | |||
84 | cases `0` will provide the most complete set. For more information see [`man 2 | 84 | cases `0` will provide the most complete set. For more information see [`man 2 |
85 | perf_event_open`](http://man7.org/linux/man-pages/man2/perf_event_open.2.html). | 85 | perf_event_open`](http://man7.org/linux/man-pages/man2/perf_event_open.2.html). |
86 | 86 | ||
87 | By default, the perf collector will only collect metrics of the CPUs that | ||
88 | `node_exporter` is running on (ie | ||
89 | [`runtime.NumCPU`](https://golang.org/pkg/runtime/#NumCPU). If this is | ||
90 | insufficient (e.g. if you run `node_exporter` with its CPU affinity set to | ||
91 | specific CPUs) You can specify a list of alternate CPUs by using the | ||
92 | `--collector.perf.cpus` flag. For example, to collect metrics on CPUs 2-6, you | ||
93 | would specify: `--collector.perf --collector.perf.cpus=2-6`. The CPU | ||
94 | configuration is zero indexed and can also take a stride value | ||
95 | `--collector.perf --collector.perf.cpus=1-10:5`, would collect on CPUs | ||
96 | 1, 5, and 10. | ||
97 | |||
98 | |||
87 | Name | Description | OS | 99 | Name | Description | OS |
88 | ---------|-------------|---- | 100 | ---------|-------------|---- |
89 | buddyinfo | Exposes statistics of memory fragments as reported by /proc/buddyinfo. | Linux | 101 | buddyinfo | Exposes statistics of memory fragments as reported by /proc/buddyinfo. | Linux |