-
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
Add laundry to mem input plugin on FreeBSD #7736
Conversation
@@ -61,6 +62,11 @@ func (s *MemStats) Gather(acc telegraf.Accumulator) error { | |||
"write_back": vm.Writeback, | |||
"write_back_tmp": vm.WritebackTmp, | |||
} | |||
|
|||
if runtime.GOOS == "freebsd" { | |||
fields["laundry"] = vm.Laundry |
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.
Need to add this to README.md, maybe with a note that it's specific to freebsd
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.
We already support active, inactive, and wired which are only valid on OS X and BSD. They're not handled conditionally at runtime. Maybe this doesn't need to be either.
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.
Active/inactive are set on Linux, despite the comment in gopsutil. We really shouldn't be adding fields that aren't set, so I went through the stats again in more detail. One situation I'm not handling yet is the non-cgo version of Darwin.
Now that we are returning different fields depending on the platform, we are running into the issue where we need the test to be different depending on the host running the tests. To get around this I added a field to the struct that can be overridden in the tests to change the platform. |
Additionally only report fields that may be set on the platform.
Additionally only report fields that may be set on the platform.
Additionally only report fields that may be set on the platform.
closes: #7726
Required for all PRs: