Fix seconds reported by schedstat (#1426)
Upstream bugfix: https://github.com/prometheus/procfs/pull/191 Signed-off-by: Phil Frost <phil@postmates.com>
This commit is contained in:
parent
75462bf4fe
commit
26d4fbdf07
10 changed files with 509 additions and 40 deletions
15
vendor/github.com/prometheus/procfs/internal/util/parse.go
generated
vendored
15
vendor/github.com/prometheus/procfs/internal/util/parse.go
generated
vendored
|
|
@ -49,6 +49,21 @@ func ParseUint64s(ss []string) ([]uint64, error) {
|
|||
return us, nil
|
||||
}
|
||||
|
||||
// ParsePInt64s parses a slice of strings into a slice of int64 pointers.
|
||||
func ParsePInt64s(ss []string) ([]*int64, error) {
|
||||
us := make([]*int64, 0, len(ss))
|
||||
for _, s := range ss {
|
||||
u, err := strconv.ParseInt(s, 10, 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
us = append(us, &u)
|
||||
}
|
||||
|
||||
return us, nil
|
||||
}
|
||||
|
||||
// ReadUintFromFile reads a file and attempts to parse a uint64 from it.
|
||||
func ReadUintFromFile(path string) (uint64, error) {
|
||||
data, err := ioutil.ReadFile(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue