Commit Graph

10 Commits

Author SHA1 Message Date
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