-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Disk IO stats and ext4 FS stats #651
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Looks like the tests still fail. Also DCO. This needs a DCO sign-off. You can use |
fecc6d2
to
3c2e1ec
Compare
DCO sign off fixed. |
Please |
1e6892d
to
d9eaa12
Compare
Done and ran |
7fa9f21
to
afabf5c
Compare
Commits squashed and rebased with master |
371d88f
to
31275d1
Compare
internal/util/parse.go
Outdated
if err != nil { | ||
return 0, err | ||
} | ||
return strconv.ParseUint(strings.TrimSpace(string(data[2:])), 16, 64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should validate that the string starts with 0x
before trying to parse the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
4d322a4
to
19c8632
Compare
internal/util/parse.go
Outdated
} | ||
hexString := strings.TrimSpace(string(data)) | ||
if !strings.HasPrefix(hexString, "0x") { | ||
return 0, fmt.Errorf("invalid format: hex string does not start with '0x'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 0, fmt.Errorf("invalid format: hex string does not start with '0x'") | |
return 0, errors.New("invalid format: hex string does not start with '0x'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Adds function to return disk stats from: * /sys/block/<disk>/device/ioerr_cnt: number of SCSI commands that completed with an error * /sys/block/<disk>/device/iodone_cnt: number of completed or rejected SCSI commands Add function to return stats for ext4 filesystem * /sys/fs/ext4/<partition>/errors_count: number of ext4 errors * /sys/fs/ext4/<partition>/warning_count: number of ext4 warning log messages * /sys/fs/ext4/<partition>/msg_count: number of other ext4 log messages Signed-off-by: Muhammad Shahzeb <[email protected]>
4597172
to
6069bcb
Compare
Related to: prometheus/node_exporter#3005
Node exporter PR: prometheus/node_exporter#3047
Adds function to return disk stats from:
/sys/block/<disk>/device/ioerr_cnt
: number of SCSI commands that completed with an error/sys/block/<disk>/device/iodone_cnt
: number of completed or rejected SCSI commandsAdd function to return stats for ext4 filesystem
/sys/fs/ext4/<partition>/errors_count
: number of ext4 errors (commit)/sys/fs/ext4/<partition>/warning_count
: number of ext4 warning log messages (commit)/sys/fs/ext4/<partition>/msg_count
: number of other ext4 log messages