diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-08-28 08:55:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 08:55:22 +0200 |
commit | 256b1781760beb08ae4bdde3c2750ea21c9c8fc6 (patch) | |
tree | 3ceb7ed14cdab8a1b8fbf169bebce1478af79522 /vendor/github.com/prometheus/procfs/proc_psi.go | |
parent | e0f95d1545eaf9cc4ebae9df1ff03d3e66d5b251 (diff) | |
download | gitea-256b1781760beb08ae4bdde3c2750ea21c9c8fc6.tar.gz gitea-256b1781760beb08ae4bdde3c2750ea21c9c8fc6.zip |
Update swagger to 0.20.1 (#8010)
* update swagger to 0.20.1
* fiw swagger version for validate
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) |