diff options
Diffstat (limited to 'vendor/github.com/prometheus/procfs/proc_psi.go')
-rw-r--r-- | vendor/github.com/prometheus/procfs/proc_psi.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go index a23d4c0f05..46fe266263 100644 --- a/vendor/github.com/prometheus/procfs/proc_psi.go +++ b/vendor/github.com/prometheus/procfs/proc_psi.go @@ -51,19 +51,10 @@ type PSIStats struct { Full *PSILine } -// NewPSIStatsForResource reads pressure stall information for the specified -// resource. At time of writing this can be either "cpu", "memory" or "io". -func NewPSIStatsForResource(resource string) (PSIStats, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return PSIStats{}, err - } - - return fs.NewPSIStatsForResource(resource) -} - -// NewPSIStatsForResource reads pressure stall information from /proc/pressure/<resource> -func (fs FS) NewPSIStatsForResource(resource string) (PSIStats, error) { +// PSIStatsForResource reads pressure stall information for the specified +// resource from /proc/pressure/<resource>. At time of writing this can be +// either "cpu", "memory" or "io". +func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { file, err := os.Open(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource))) if err != nil { return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %s", resource) |