-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(inputs.diskio): Add field io await and util #15950
base: master
Are you sure you want to change the base?
Conversation
Thanks so much for the pull request! |
add util/await/svctm #15951 |
done !signed-cla |
69f724b
to
8a079dc
Compare
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 @jiangxianfu for your contribution! I do have some comments in the code.
plugins/inputs/diskio/diskio.go
Outdated
fieldsG := make(map[string]interface{}) | ||
if deltaRWCount > 0 { | ||
fieldsG["io_await"] = deltaRWTime / deltaRWCount | ||
fieldsG["io_svctm"] = deltaIOTime / deltaRWCount | ||
} | ||
itv := float64(collectTime.Sub(d.lastCollectTime).Milliseconds()) | ||
if itv > 0 { | ||
fieldsG["io_util"] = 100 * deltaIOTime / itv | ||
} | ||
if len(fieldsG) > 0 { | ||
acc.AddGauge("diskio", fieldsG, tags) | ||
} |
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.
Why do you create a new metric instead of simply adding the fields to the existing metric?
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 is because the other metrics are of type "Counter", while the newly added values are of type "Gauge"
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.
Please do not resolve conversations that are still discussed! I'm not fully convinced by that argument as iops_in_progress
is also tagged as gauge
. If the type is really an issue, you should at least use a different metric name.
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
Summary
In practical scenarios, it may be necessary to check the values for disk I/O wait, I/O util, and I/O svctm.
Therefore, I would like to add these three metrics.