ZFS Collector: Add xuio_stats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
This commit is contained in:
parent
3c9e779989
commit
05048c067d
5 changed files with 80 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ const (
|
|||
zfsArcstatsExt = "arcstats"
|
||||
zfsFetchstatsExt = "zfetchstats"
|
||||
zfsVdevCacheStatsExt = "vdev_cache_stats"
|
||||
zfsXuioStatsExt = "xuio_stats"
|
||||
zfsZilExt = "zil"
|
||||
)
|
||||
|
||||
|
|
@ -91,6 +92,18 @@ func (c *zfsCollector) updateVdevCacheStats(ch chan<- prometheus.Metric) (err er
|
|||
})
|
||||
}
|
||||
|
||||
func (c *zfsCollector) updateXuioStats(ch chan<- prometheus.Metric) (err error) {
|
||||
file, err := c.openProcFile(filepath.Join(zfsProcpathBase, zfsXuioStatsExt))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
return c.parseProcfsFile(file, zfsXuioStatsExt, func(s zfsSysctl, v zfsMetricValue) {
|
||||
ch <- c.constSysctlMetric(xuio, s, v)
|
||||
})
|
||||
}
|
||||
|
||||
func (c *zfsCollector) parseProcfsFile(reader io.Reader, fmt_ext string, handler func(zfsSysctl, zfsMetricValue)) (err error) {
|
||||
scanner := bufio.NewScanner(reader)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue