diff options
Diffstat (limited to 'vendor/github.com/prometheus/procfs/fs.go')
-rw-r--r-- | vendor/github.com/prometheus/procfs/fs.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/prometheus/procfs/fs.go b/vendor/github.com/prometheus/procfs/fs.go index 49aaab050..17546756b 100644 --- a/vendor/github.com/prometheus/procfs/fs.go +++ b/vendor/github.com/prometheus/procfs/fs.go @@ -4,6 +4,8 @@ import ( "fmt" "os" "path" + + "github.com/prometheus/procfs/xfs" ) // FS represents the pseudo-filesystem proc, which provides an interface to @@ -31,3 +33,14 @@ func NewFS(mountPoint string) (FS, error) { func (fs FS) Path(p ...string) string { return path.Join(append([]string{string(fs)}, p...)...) } + +// XFSStats retrieves XFS filesystem runtime statistics. +func (fs FS) XFSStats() (*xfs.Stats, error) { + f, err := os.Open(fs.Path("fs/xfs/stat")) + if err != nil { + return nil, err + } + defer f.Close() + + return xfs.ParseStats(f) +} |