aboutsummaryrefslogtreecommitdiff
path: root/collector/filesystem_freebsd.go
diff options
context:
space:
mode:
authorJohannes 'fish' Ziemke <github@freigeist.org>2017-01-03 15:55:40 +0100
committerJohannes 'fish' Ziemke <github@freigeist.org>2017-01-04 16:45:25 +0100
commit4c9131b7d8131a10dbaebffea9af0c7bb6f0a8a7 (patch)
treec45c900971b926a7ad9135b4701452c4e6ccf228 /collector/filesystem_freebsd.go
parent26c6182c8452b6a5990586e744695a1b5bc5fc54 (diff)
downloadprometheus_node_collector-4c9131b7d8131a10dbaebffea9af0c7bb6f0a8a7.tar.bz2
prometheus_node_collector-4c9131b7d8131a10dbaebffea9af0c7bb6f0a8a7.tar.xz
prometheus_node_collector-4c9131b7d8131a10dbaebffea9af0c7bb6f0a8a7.zip
Make sure we only return one metric per mounted fs
Diffstat (limited to 'collector/filesystem_freebsd.go')
-rw-r--r--collector/filesystem_freebsd.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/collector/filesystem_freebsd.go b/collector/filesystem_freebsd.go
index 8bd697b..a18945a 100644
--- a/collector/filesystem_freebsd.go
+++ b/collector/filesystem_freebsd.go
@@ -73,15 +73,18 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
73 ro = 1 73 ro = 1
74 } 74 }
75 75
76 labelValues := []string{device, mountpoint, fstype}
77 stats = append(stats, filesystemStats{ 76 stats = append(stats, filesystemStats{
78 labelValues: labelValues, 77 labels: filesystemLabels{
79 size: float64(fs.Blocks) * float64(fs.Bsize), 78 device: device,
80 free: float64(fs.Bfree) * float64(fs.Bsize), 79 mountPoint: mountpoint,
81 avail: float64(fs.Bavail) * float64(fs.Bsize), 80 fsType: fstype,
82 files: float64(fs.Files), 81 },
83 filesFree: float64(fs.Ffree), 82 size: float64(fs.Blocks) * float64(fs.Bsize),
84 ro: ro, 83 free: float64(fs.Bfree) * float64(fs.Bsize),
84 avail: float64(fs.Bavail) * float64(fs.Bsize),
85 files: float64(fs.Files),
86 filesFree: float64(fs.Ffree),
87 ro: ro,
85 }) 88 })
86 } 89 }
87 return stats, nil 90 return stats, nil