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 node_filesystem_device_errors_total metric #374

Merged
merged 1 commit into from
Dec 26, 2016

Conversation

discordianfish
Copy link
Member

This metric is the total number of errors occurred when getting stats
for the given device.

This closes #325

This metric is the total number of errors occurred when getting stats
for the given device.
@SuperQ
Copy link
Member

SuperQ commented Dec 22, 2016

It'd be nice if there was a test for this, not sure how easy that would be.

@discordianfish
Copy link
Member Author

@SuperQ Yes more tests would be nice in general, but not sure how to do in such case. Mocking up those things seems silly, but to be honest I'm not a testing expert. Maybe we could actually run the node-exporter on some frozen VM state but that seems a big project. Either way, I'd say it's not a blocker to merge this.

@SuperQ
Copy link
Member

SuperQ commented Dec 22, 2016

Testing would involve mocking syscall.Statfs() to return and error, and calling GetStats(). Then checking to see if the counter increased. Not terribly hard, but not super easier either. I think this is fine for now.

@discordianfish
Copy link
Member Author

@SuperQ Yes but that would mean turning this call into some interface to mock it. Not sure it's worth it, given how this would apply to so many things in the exporter. That why I was thinking about using a frozen VM or something. But first things first.

@discordianfish discordianfish merged commit d506b22 into master Dec 26, 2016
@discordianfish discordianfish deleted the fish-add-filesystem-errors branch December 26, 2016 10:51
@SuperQ SuperQ mentioned this pull request Jan 15, 2017
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.

is there a way to check is a disk broken
2 participants