Ignore boring filesystems from disk plugin
Modern Linux has a lots of boring filesystem (tmpfs on /dev, devpts on /dev/pts, lots of cgroup on /sys/fs/cgroup/*, ...). * Ignore filesystem with 0 bytes (this cover cgroup, devpts and other). * Add IgnoreFS to ignore additional FS by their type. Add tmpfs and devtmpfs as default ignored type.
This commit is contained in:
committed by
Cameron Sparr
parent
9687f71a17
commit
47ad73cc89
@@ -50,9 +50,9 @@ func TestDiskStats(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
mps.On("DiskUsage", []string(nil)).Return(duAll, nil)
|
||||
mps.On("DiskUsage", []string{"/", "/dev"}).Return(duFiltered, nil)
|
||||
mps.On("DiskUsage", []string{"/", "/home"}).Return(duAll, nil)
|
||||
mps.On("DiskUsage", []string(nil), []string(nil)).Return(duAll, nil)
|
||||
mps.On("DiskUsage", []string{"/", "/dev"}, []string(nil)).Return(duFiltered, nil)
|
||||
mps.On("DiskUsage", []string{"/", "/home"}, []string(nil)).Return(duAll, nil)
|
||||
|
||||
err = (&DiskStats{ps: &mps}).Gather(&acc)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user