Scrape CPU latency stats from /proc/schedstat (#1389)
These are useful as a direct indication of CPU contention and task scheduler latency. Handy references: - https://github.com/torvalds/linux/blob/master/Documentation/scheduler/sched-stats.txt - https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha.tuning.taskscheduler.html procfs is updated to pull in the enabling change: https://github.com/prometheus/procfs/pull/186 Signed-off-by: Phil Frost <phil@postmates.com>
This commit is contained in:
parent
777b751f90
commit
f693a71c06
13 changed files with 297 additions and 5 deletions
9
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
9
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
|
|
@ -300,3 +300,12 @@ func (p Proc) FileDescriptorsInfo() (ProcFDInfos, error) {
|
|||
|
||||
return fdinfos, nil
|
||||
}
|
||||
|
||||
// Schedstat returns task scheduling information for the process.
|
||||
func (p Proc) Schedstat() (ProcSchedstat, error) {
|
||||
contents, err := ioutil.ReadFile(p.path("schedstat"))
|
||||
if err != nil {
|
||||
return ProcSchedstat{}, err
|
||||
}
|
||||
return parseProcSchedstat(string(contents))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue