Skip to content

Commit

Permalink
Merge pull request #32 from fearful-symmetry/process_add_disk_sleep
Browse files Browse the repository at this point in the history
Add uninterruptible disk sleep to system/process metrics
  • Loading branch information
fearful-symmetry authored Jun 2, 2022
2 parents 5ccb506 + d920ed8 commit 76c4b10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Move pacakges from Metricbeat: `internal/metrics/cpu` and `internal/metrics/memory`. #27
- Add `D` process states. #32

### Changed

Expand Down
8 changes: 5 additions & 3 deletions metric/system/process/process_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ var (
Running PidState = "running"
//Sleeping state
Sleeping PidState = "sleeping"
//Idle state. On linux this is "D"
//Idle state.
Idle PidState = "idle"
//DiskSleep is uninterruptible disk sleep
DiskSleep PidState = "disk_sleep"
//Stopped state.
Stopped PidState = "stopped"
//Zombie state.
Expand All @@ -99,8 +101,8 @@ var (
var PidStates = map[byte]PidState{
'S': Sleeping,
'R': Running,
'D': Idle, // Waiting in uninterruptible disk sleep, on some kernels this is marked as I below
'I': Idle, // in the scheduler, TASK_IDLE is defined as (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)
'D': DiskSleep, // Waiting in uninterruptible disk sleep, on some kernels this is marked as I below
'I': Idle, // in the scheduler, TASK_IDLE is defined as (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)
'T': Stopped,
'Z': Zombie,
'X': Dead,
Expand Down

0 comments on commit 76c4b10

Please sign in to comment.