Commit graph

15 commits

Author SHA1 Message Date
Ben Kochie dfa53f835a
Use Go 1.13 error features
* Use `errors.Is()` for unwrapping errors.
* Use `%w` error verb in internal error formatting.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-06-16 14:47:03 +02:00
Shapor Naghibzadeh a1a3633d89 Move regexp to global in meminfo_linux.go
Compile regexp outside of parsing function in meminfo_linux.go

Signed-off-by: Shapor Naghibzadeh <shapor@google.com>
2020-04-26 01:13:25 -07:00
alpaca fa4edd700e
Fix accidently empty lines in meminfo_linux (#1671)
* Fix accidently empty lines in meminfo_linux

Signed-off-by: qwertysun <qwertysun@tencent.com>
2020-04-17 12:07:35 +02:00
Brian Brazil a98067a294 Make metrics better follow guidelines (#787)
* Improve stat linux metric names.

cpu is no longer used.

* node_cpu -> node_cpu_seconds_total for Linux

* Improve filesystem metric names with units

* Improve units and names of linux disk stats

Remove sector metrics, the bytes metrics cover those already.

* Infiniband counters should end in _total

* Improve timex metric names, convert to more normal units.

See
3c073991eb/kernel/time/ntp.c (L909)
for what stabil means, looks like a moving average of some form.

* Update test fixture

* For meminfo metrics that had "kB" units, add _bytes

* Interrupts counter should have _total
2018-01-17 17:55:55 +01:00
Tobias Schmidt 084e585c2a Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
Tobias Schmidt 694294baf5 Remove unnecessary conversions 2017-02-28 13:57:49 -04:00
Tobias Schmidt 21e13c7f52 Simplify code 2017-02-28 13:54:27 -04:00
Johannes 'fish' Ziemke 2983c4a31d Refactor meminfo collector similar to filesystem
Instead of doing the whole metric exposition in a platform specific collector
implementation, this creates and updates the metrics in meminfo.go and
expected a platform specific implementation of getMemInfo on
*meminfoCollector.
2017-01-03 11:20:36 +01:00
Julius Volz eac396c637 Convert meminfo collector to use ConstMetrics
This suffers from the same concurrency bug as the netstat one:
https://github.com/prometheus/node_exporter/issues/280
2016-08-12 01:30:15 +02:00
Nick Owens eb79937340 switch to github.com/prometheus/common/log for logging 2015-10-30 13:20:06 -07:00
Julius Volz a25751e0b3 Fix occurreneces of initial uppercase in error strings. 2015-10-11 22:37:43 +02:00
Matthias Rampke 2d0d72b97d Add license headers to all code files. 2015-09-26 17:44:39 +02:00
Matthias Rampke 20b551ab2b Add flag to change the location of the procfs.
Remove all hardcoded references to `/proc`. For all collectors that do
not use `github.com/prometheus/procfs` yet, provide a wrapper to
generate the full paths.

Reformulate help strings, errors and comments to remove absolute
references to `/proc`.

This is a breaking change: the `-collector.ipvs.procfs` flag is removed
in favor of the general flag. Since it only affected that collector it
was only useful for development, so this should not cause many issues.
2015-09-26 15:32:10 +02:00
Siavash Safi d7ec7eac1f Revert "Add build constraint for linux collectors." 2015-07-14 13:58:44 +04:30
Siavash Safi 4c5db2787e Add meminfo collector for FreeBSD. 2015-07-14 13:58:44 +04:30
Renamed from collector/meminfo.go (Browse further)