-
Notifications
You must be signed in to change notification settings - Fork 91
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 Linux Networking counters #72
Add Linux Networking counters #72
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.
LGTM, just added some suggestions on tests, let me know what you think.
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.
Just some minor comments. Overall LGTM.
@@ -0,0 +1,12 @@ | |||
cpu 31608779 223223 15924288 1134746753 223880 4348430 1995355 266903 0 0 |
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.
I don't see where this file is being used in the PR. If it's not used then let's remove it.
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.
Apparently the code will try and find a /proc/host
file before it does anything else. Without this the test will fail.
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.
Just one small thing I noticed. LGTM otherwise.
See elastic/beats#12210
Started this before I left for a 4-day weekend so it might be a tad all over, hopefully not.
I fear this is a case of me being a bit too 'clever' since I came up with a way to have one method that populates all of the structs. It would be possible to combine
fillStruct
andreadAndParseNetFile
, but then we would needFieldbyName
as opposed toField
to get the struct, which means each call would iterate over the structNumField()
times asFieldByName
just iterates until it gets a given name. I would still like to find a better way to do this.Other than that, this is fairly straight forward. The mapping of struct field -> map is because the network counter types are known, but there's basically no documentation on the counters themselves, they're just random kernel fields. I think it would be better to have this library be more neutral, and any editorializing/filtering can be done in metricbeat.
Ah! Still need to update the readme.