Node_Exporter/collector
ideaship 8d90276283 Add bcache collector (#597)
* Add bcache collector for Linux

This collector gathers metrics related to the Linux block cache
(bcache) from sysfs.

* Removed commented out code

* Use project comment style

* Add _sectors to metric name to indicate unit

* Really use project comment style

* Rename bcache.go to bcache_linux.go

* Keep collector namespace clean

Rename:
- metric -> bcacheMetric
- periodStatsToMetrics -> bcachePeriodStatsToMetric

* Shorten slice initialization

* Change label names to backing_device, cache_device

* Remove five minute metrics (keep only total)

* Include units in additional metric names

* Enable bcache collector by default

* Provide metrics in seconds, not nanoseconds

* remove metrics with label "all"

* Add fixtures, update end-to-end for bcache collector

* Move fixtures/sys into tar.gz

This changeset moves the collector/fixtures/sys directory into
collector/fixtures/sys.tar.gz and tweaks the Makefile to unpack the
tarball before tests are run.

The reason for this change is that Windows does not allow colons in a
path (colons are present in some of the bcache fixture files), nor can
it (out of the box) deal with pathnames longer than 260 characters
(which we would be increasingly likely to hit if we tried to replace
colons with longer codes that are guaranteed not the turn up in regular
file names).

* Add ttar: plain text archive, replacement for tar

This changeset adds ttar, a plain text replacement for tar, and uses it
for the sysfs fixture archive. The syntax is loosely based on tar(1).

Using a plain text archive makes it possible to review changes without
downloading and extracting the archive. Also, when working on the repo,
git diff and git log become useful again, allowing a committer to verify
and track changes over time.

The code is written in bash, because bash is available out of the box on
all major flavors of Linux and on macOS. The feature set used is
restricted to bash version 3.2 because that is what Apple is still
shipping.

The programm also works on Windows if bash is installed. Obviously, it
does not solve the Windows limitations (path length limited to 260
characters, no symbolic links) that prompted the move to an archive
format in the first place.
2017-07-07 07:20:18 +02:00
..
fixtures Add bcache collector (#597) 2017-07-07 07:20:18 +02:00
ganglia Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
arp_linux.go Add ARP collector for Linux (#540) 2017-04-11 17:45:19 +02:00
bcache_linux.go Add bcache collector (#597) 2017-07-07 07:20:18 +02:00
bonding_linux_test.go Rearrange fixtures to match "real" proc and sys. 2015-09-28 13:56:22 +00:00
bonding_linux.go Handle nonexisting bonding_masters file (#569) 2017-04-24 23:19:17 +04:00
buddyinfo.go Remove Windows support 2017-04-10 23:27:23 -03:00
collector.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
conntrack_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
cpu_darwin.go Add cpu collector for darwin 2016-12-28 18:38:52 +01:00
cpu_dragonfly_test.go Add test 2016-09-28 09:10:05 +02:00
cpu_dragonfly.go Add test 2016-09-28 09:10:05 +02:00
cpu_freebsd.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
cpu_linux.go Add link to kernel documentation for sysfs/cpufreq files 2017-06-27 11:25:06 +02:00
devstat_dragonfly.go Fixes broken build on Dragonfly. 2017-04-17 10:50:49 -04:00
devstat_freebsd.c Add missing license headers 2017-01-05 06:18:34 +01:00
devstat_freebsd.go Add missing dependency for static FreeBSD build 2017-03-20 16:59:45 +00:00
devstat_freebsd.h Add missing license headers 2017-01-05 06:18:34 +01:00
diskstats_darwin.go add diskstats on Darwin (#593) 2017-07-06 13:51:24 +02:00
diskstats_linux_test.go Calculate Linux disk bytes read/written based on sector size (512B) 2015-12-27 22:00:02 +11:00
diskstats_linux.go Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
drbd_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
edac_linux.go edac: Fix typo in csrow label of node_edac_csrow_uncorrectable_errors_total metric. 2017-04-18 12:45:06 +02:00
entropy_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
exec_bsd.go Fix metric name per review. 2017-04-21 16:25:31 -04:00
filefd_linux_test.go Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
filefd_linux.go Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
filesystem_bsd.go Fix lint issues on filesystem BSD implementation 2017-03-22 21:48:12 -03:00
filesystem_common.go Correct typo (#582) 2017-05-14 19:46:23 +02:00
filesystem_freebsd.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
filesystem_linux.go Fix export of stale device error metrics for unmounted filesystems 2017-03-22 21:48:18 -03:00
gmond.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
helper.go Delete unused code 2017-02-28 17:20:16 -04:00
hwmon_linux.go Remove more unnecessarily named return values 2017-02-28 17:33:46 -04:00
infiniband_linux_test.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
infiniband_linux.go Multiply port data XMIT/RCV metrics by 4 (#579) 2017-05-12 07:28:53 +02:00
interrupts_common.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
interrupts_linux_test.go Rearrange fixtures to match "real" proc and sys. 2015-09-28 13:56:22 +00:00
interrupts_linux.go Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
interrupts_openbsd.go Convert remaining collectors to use ConstMetrics 2017-01-03 14:11:10 +01:00
ipvs_linux_test.go Delete unused code 2017-02-28 17:20:16 -04:00
ipvs_linux.go Convert remaining collectors to use ConstMetrics 2017-01-03 14:11:10 +01:00
ksmd_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
loadavg_freebsd.go Implement loadavg on FreeBSD without cgo 2016-12-26 23:06:05 +01:00
loadavg_linux_test.go Add load5 and load15 to linux load metric 2015-10-17 13:07:39 +00:00
loadavg_linux.go collector: support 1,5,15m load averages for all unices 2015-10-31 06:04:24 -07:00
loadavg_solaris.go Added loadavg collector for solaris 2017-01-04 17:45:40 -08:00
loadavg_unix.go Added loadavg collector for solaris 2017-01-04 17:45:40 -08:00
loadavg.go Remove Windows support 2017-04-10 23:27:23 -03:00
logind_linux_test.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
logind_linux.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
mdadm_linux_test.go Fix and simplify parsing of raid metrics 2017-03-19 08:03:58 -03:00
mdadm_linux.go mdadm: Remove extra file existence check 2017-03-22 10:11:19 -03:00
megacli_test.go Add license headers to all code files. 2015-09-26 17:44:39 +02:00
megacli.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
meminfo_bsd.go Add exec_boot_time for freebsd, dragonfly 2017-04-21 10:23:19 -04:00
meminfo_darwin.go Add meminfo stats for Darwin 2017-01-03 11:22:46 +01:00
meminfo_linux_test.go Rearrange fixtures to match "real" proc and sys. 2015-09-28 13:56:22 +00:00
meminfo_linux.go Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
meminfo_numa_linux_test.go Add Linux NUMA "numastat" metrics (#249) 2016-10-12 13:07:49 +02:00
meminfo_numa_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
meminfo.go Remove Windows support 2017-04-10 23:27:23 -03:00
mountstats_linux.go Fix gofmt -s and spelling issues 2017-02-28 14:01:28 -04:00
netdev_bsd_test.go Compile netdev on dragonfly (#314) 2016-09-27 21:44:13 +01:00
netdev_bsd.go Compile netdev on dragonfly (#314) 2016-09-27 21:44:13 +01:00
netdev_common.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
netdev_darwin.go Add netdev collector for darwin 2016-12-29 19:17:15 +01:00
netdev_linux_test.go Simplify code 2017-02-28 13:54:27 -04:00
netdev_linux.go Remove unnecessary conversions 2017-02-28 13:57:49 -04:00
netdev_openbsd.go Do a make format run. 2015-12-18 14:08:52 +00:00
netstat_linux_test.go Rearrange fixtures to match "real" proc and sys. 2015-09-28 13:56:22 +00:00
netstat_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
nfs_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
ntp.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
paths_test.go Add a flag for the sysfs location. 2015-09-28 13:56:22 +00:00
paths.go Add a flag for the sysfs location. 2015-09-28 13:56:22 +00:00
qdisc_linux.go Add qdisc collector for Linux (#580) 2017-05-23 11:55:50 +02:00
runit.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
sockstat_linux_test.go sockstat: add support for RHE4 2016-07-05 23:24:54 +02:00
sockstat_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
stat_linux.go Move stat_linux to cpu_linux and add cpufreq stats (#548) 2017-06-13 11:21:53 +02:00
supervisord.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
sysctl_bsd.go Add exec_boot_time for freebsd, dragonfly 2017-04-21 10:23:19 -04:00
systemd_linux_test.go Fix gofmt -s and spelling issues 2017-02-28 14:01:28 -04:00
systemd_linux.go Blacklist systemd scope units 2017-03-23 14:02:46 +01:00
tcpstat_linux_test.go Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
tcpstat_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
textfile_test.go Suppress log noise from textfile collector test. 2015-09-28 13:56:22 +00:00
textfile.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
time.go Get full resolution for node_time (#555) 2017-04-19 18:31:21 +01:00
uname_linux_int8.go uname_linux: Build for 32bit MIPS too 2017-04-20 13:30:40 +02:00
uname_linux_uint8.go add s390x support 2016-08-24 08:06:04 -04:00
uname_linux.go Fix uname collector for arm/ppc64/ppc64le architectures 2015-10-03 16:17:15 -04:00
vmstat_linux.go Remove unnecessarily named return variables 2017-02-28 16:04:25 -04:00
wifi_linux.go Expand wifi collector for more interface types 2017-03-20 12:25:01 -04:00
xfs_linux.go Initial XFS collector 2017-04-22 11:53:07 -04:00
zfs_linux_test.go ZFS Collector: Add zpool IO statistics 2017-02-10 13:31:25 -06:00
zfs_linux.go Remove more unnecessarily named return values 2017-02-28 17:33:46 -04:00
zfs.go Delete unused code 2017-02-28 17:20:16 -04:00