Commit Graph

15 Commits

Author SHA1 Message Date
Ben Ye
2477c5c67d switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-12-31 17:19:37 +01:00
Calle Pettersson
859a825bb8 Replace --collectors.enabled with per-collector flags (#640)
* Move NodeCollector into package collector

* Refactor collector enabling

* Update README with new collector enabled flags

* Fix out-of-date inline flag reference syntax

* Use new flags in end-to-end tests

* Add flag to disable all default collectors

* Track if a flag has been set explicitly

* Add --collectors.disable-defaults to README

* Revert disable-defaults flag

* Shorten flags

* Fixup timex collector registration

* Fix end-to-end tests

* Change procfs and sysfs path flags

* Fix review comments
2017-09-28 15:06:26 +02:00
Karsten Weiss
b2f4fd5776 Remove unused devstatCollector struct member 'bytes_total'.
This also fixes this golint issue:

devstat_freebsd.go:40:2: don't use underscores in Go names; struct field bytes_total should be bytesTotal
2017-05-14 19:51:53 +02:00
Karsten Weiss
6720cfdbfe golint: Fix comment on exported function NewDevstatCollector. 2017-05-14 13:21:39 +02:00
Juergen Hoetzel
aef2601cf6 Add missing dependency for static FreeBSD build 2017-03-20 16:59:45 +00:00
Dominik Honnef
38c5890428 Reuse devinfo struct
The devstat API expects us to reuse one devinfo for many invocations of
devstat_getstats. In particular, it allocates and resizes memory
referenced by devinfo.
2017-01-05 05:38:26 +01:00
Dominik Honnef
ea55d0f5cb Don't race in FreeBSD devstat collector
Querying the number of devices separately from the device list itself is
racy. Devices may be added or removed between the two calls; and removed
devices would lead to a segfault.
2017-01-05 05:38:26 +01:00
Dominik Honnef
5e220c1665 Move cgo portions of FreeBSD devstat collector into own file
Embedding 100 lines of code in a comment doesn't make for good reading,
editing or code quality.
2017-01-05 05:38:26 +01:00
Dominik Honnef
20ca0f1376 Eliminate memory leak in FreeBSD devstat collector
The memory allocated by calloc was never freed. Since the devinfo struct
never leaves the function, anyway, we might as well just allocate it on
the stack.
2017-01-05 05:38:26 +01:00
Johannes 'fish' Ziemke
8e50b80d12 Convert remaining collectors to use ConstMetrics 2017-01-03 14:11:10 +01:00
Matthias Rampke
2d0d72b97d Add license headers to all code files. 2015-09-26 17:44:39 +02:00
Siavash Safi
dddb273dfc Fix some error messages. 2015-07-14 13:58:54 +04:30
Siavash Safi
93708f3dda devstat: Fix metric types, disable free metrics. 2015-07-14 13:58:53 +04:30
Siavash Safi
71abff14b1 devstat: Fix wrong labels for 'other' metrics. 2015-07-14 13:58:49 +04:30
Siavash Safi
c5669f0a1a Add devstat collector for FreeBSD. 2015-07-14 13:58:48 +04:30