fix application bug
This commit is contained in:
9
vendor/github.com/prometheus/procfs/proc_stat.go
generated
vendored
9
vendor/github.com/prometheus/procfs/proc_stat.go
generated
vendored
@@ -18,6 +18,8 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/prometheus/procfs/internal/fs"
|
||||
)
|
||||
|
||||
// Originally, this USER_HZ value was dynamically retrieved via a sysconf call
|
||||
@@ -99,7 +101,7 @@ type ProcStat struct {
|
||||
// Resident set size in pages.
|
||||
RSS int
|
||||
|
||||
fs FS
|
||||
proc fs.FS
|
||||
}
|
||||
|
||||
// NewStat returns the current status information of the process.
|
||||
@@ -118,7 +120,7 @@ func (p Proc) NewStat() (ProcStat, error) {
|
||||
var (
|
||||
ignore int
|
||||
|
||||
s = ProcStat{PID: p.PID, fs: p.fs}
|
||||
s = ProcStat{PID: p.PID, proc: p.fs}
|
||||
l = bytes.Index(data, []byte("("))
|
||||
r = bytes.LastIndex(data, []byte(")"))
|
||||
)
|
||||
@@ -175,7 +177,8 @@ func (s ProcStat) ResidentMemory() int {
|
||||
|
||||
// StartTime returns the unix timestamp of the process in seconds.
|
||||
func (s ProcStat) StartTime() (float64, error) {
|
||||
stat, err := s.fs.NewStat()
|
||||
fs := FS{proc: s.proc}
|
||||
stat, err := fs.NewStat()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user