-
Notifications
You must be signed in to change notification settings - Fork 320
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
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 <mhmdshahzeb1993@gmail.com>
4597172
to
6069bcb
Compare
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 <mhmdshahzeb1993@gmail.com>
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 <mhmdshahzeb1993@gmail.com> Signed-off-by: fs185143 <fs185143@ncr.com>
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