Skip to content
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.IOCountersForNames function #347

Merged
merged 2 commits into from
Apr 10, 2017
Merged

Add disk.IOCountersForNames function #347

merged 2 commits into from
Apr 10, 2017

Conversation

danielnelson
Copy link
Contributor

Operates like disk.IOCounters, but accepts an array of names to limit the results.

I only tested this on linux.

Should address #341

Operates like disk.IOCounters, but accepts an array of names to limit
the results.
@danielnelson
Copy link
Contributor Author

I'll setup a branch of Telegraf tomorrow and we can use it to make sure this improves the performance on systems with many disks.

@danielnelson
Copy link
Contributor Author

@beheerderdag Can you try out this build on your system which uses the introduced functions?

@beheerderdag
Copy link

Thanks for this. Yes, it seems to be behaving ok.


root# ./telegraf.fix version
Telegraf v1.2.0-rc1-124-g4425235 (git: diskio-names 4425235)

root# time telegraf.fix -config /etc/telegraf/telegraf.conf -input-filter diskio -test
* Plugin: inputs.diskio, Collection 1
> diskio,name=sda,host=dmf writes=8658237i,read_time=22333256i,io_time=106042656i,reads=1729290i,read_bytes=103658150400i,write_bytes=240348573696i,write_time=566561988i,iops_in_progress=0i 1491817752000000000
> diskio,name=sdb,host=dmf writes=35678i,read_bytes=3509836288i,read_time=9349424i,write_time=7089736i,iops_in_progress=0i,reads=1576950i,io_time=9374672i,write_bytes=84229632i 1491817752000000000

real    0m0.419s
user    0m0.052s
sys     0m0.372s

@shirou
Copy link
Owner

shirou commented Apr 10, 2017

Thank you everyone!

@shirou shirou merged commit f5781ca into shirou:master Apr 10, 2017
@phemmer
Copy link

phemmer commented Apr 13, 2017

Too little too late, but since this hasn't made it into an official release yet, what about just making disk.IOCounters() a variadic? That would preserve compatability without having to introduce disk.IOCountersForNames().

@danielnelson
Copy link
Contributor Author

@shirou This is a pretty good idea, I could do this if you like.

@danielnelson danielnelson deleted the io-counters-for-names branch April 13, 2017 17:37
@shirou
Copy link
Owner

shirou commented Apr 13, 2017

@phemmer oh, I think it would great!
@danielnelson Do you mind making a PR?
Thank you!

@danielnelson
Copy link
Contributor Author

#351

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants