to filter by filesystem type, we need to pass that up the chain
This commit is contained in:
parent
540ba6d6ae
commit
bba162c55b
|
@ -25,8 +25,8 @@ func (s *DiskStats) Gather(acc plugins.Accumulator) error {
|
||||||
for _, du := range disks {
|
for _, du := range disks {
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"path": du.Path,
|
"path": du.Path,
|
||||||
|
"fstype": du.Fstype,
|
||||||
}
|
}
|
||||||
|
|
||||||
acc.Add("total", du.Total, tags)
|
acc.Add("total", du.Total, tags)
|
||||||
acc.Add("free", du.Free, tags)
|
acc.Add("free", du.Free, tags)
|
||||||
acc.Add("used", du.Total-du.Free, tags)
|
acc.Add("used", du.Total-du.Free, tags)
|
||||||
|
|
|
@ -63,6 +63,7 @@ func (s *systemPS) DiskUsage() ([]*disk.DiskUsageStat, error) {
|
||||||
|
|
||||||
for _, p := range parts {
|
for _, p := range parts {
|
||||||
du, err := disk.DiskUsage(p.Mountpoint)
|
du, err := disk.DiskUsage(p.Mountpoint)
|
||||||
|
du.Fstype = p.Fstype
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
|
|
||||||
type DiskUsageStat struct {
|
type DiskUsageStat struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
|
Fstype string `json:"fstype"`
|
||||||
Total uint64 `json:"total"`
|
Total uint64 `json:"total"`
|
||||||
Free uint64 `json:"free"`
|
Free uint64 `json:"free"`
|
||||||
Used uint64 `json:"used"`
|
Used uint64 `json:"used"`
|
||||||
|
|
Loading…
Reference in New Issue