Update procfs to v0.0.4-0.20190627154503-39e1aff1547e (#1409)
procfs v0.0.4-0.20190627154503-39e1aff1547e is a requirement for https://github.com/prometheus/node_exporter/pull/1357 (because procfs v0.0.3 contained bug https://github.com/prometheus/procfs/pull/187) Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
This commit is contained in:
parent
3f49b31101
commit
cdd9a5fdef
8 changed files with 642 additions and 8 deletions
21
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
21
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
|
|
@ -279,3 +279,24 @@ func (p Proc) fileDescriptors() ([]string, error) {
|
|||
func (p Proc) path(pa ...string) string {
|
||||
return p.fs.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...)
|
||||
}
|
||||
|
||||
// FileDescriptorsInfo retrieves information about all file descriptors of
|
||||
// the process.
|
||||
func (p Proc) FileDescriptorsInfo() (ProcFDInfos, error) {
|
||||
names, err := p.fileDescriptors()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var fdinfos ProcFDInfos
|
||||
|
||||
for _, n := range names {
|
||||
fdinfo, err := p.FDInfo(n)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
fdinfos = append(fdinfos, *fdinfo)
|
||||
}
|
||||
|
||||
return fdinfos, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue