Move FreeBSD/DragonflyBSD out of meminfo add kvm.#547
Conversation
|
Please rebase against master to pick up the fixes for the test pipeline and fix merge conflicts. |
0aab896 to
4909f01
Compare
|
Looks good beside the typos. I'd try to avoid CGO where possible but overall this seems reasonable. |
mdlayher
left a comment
There was a problem hiding this comment.
Note that I didn't closely review the C portion, but the Go seems okay except for one potential data race that I can see.
There was a problem hiding this comment.
I think you'll also want to guard this boolean with the mutex.
There was a problem hiding this comment.
Thanks for the feedback. I could do that. I think my initial reasoning was that at the moment, hasErr is a cached thing anyway. A second call into _kvm_swap_used_pages when hasErr is true doesn't really matter, yet. The _kvm_swap_used_pages function has all the kvm state self contained, and recreates it on each call. Perhaps the correct thing is just to rip it out, as it hasn't been proven to do anything helpful yet anyway - it's just intuition.
|
Nice, maybe you should see #710 and modify the |
There was a problem hiding this comment.
Proposal :
dataType: bsdSysctlTypeUint64,
There was a problem hiding this comment.
Thanks for the heads up. Will rebase on master when #710 is solved.
|
@derekmarcotte #710 is solved. Can you rebase this? Then I think we can finally merge it. |
|
@discordianfish Fantastic, thanks! FWIW, 6f0915f is rebased on master, and includes the changes from #710. |
|
It'd be nice if these had tests, but I don't know of a good way to mock these. In theory we'll be able to do end-to-end testing with buildkite. |
|
@SuperQ: agreed on both counts. I've got a branch on my dev box where I've begun making the end-to-end test multi-platform. Working on a few other things ahead of that for now, but it's definitely on my radar. |
6f0915f to
13004c2
Compare
|
I'd say let's rebase this and get it merged, we can still add tests later. |
This gives us SwapUsed, and everything under one roof.
|
Rebased as of 6be0f84 |
* Move FreeBSD/DragonflyBSD out of meminfo add kvm. This gives us SwapUsed, and everything under one roof. * Fix typos per review. * Update to use newer API. * Remove premature optimization per PR feedback.
Increase the /proc/stat scanner tokens size from the default of 65k to 1024k. This allows for scanning of large `intr` lines with > 65k columns. * Increase the scanner buffer from the default 4kB to 8kB bytes at a time. Fixes: prometheus/procfs#546 Signed-off-by: SuperQ <superq@gmail.com>
This gives us memory_swap_used_bytes, and everything under one roof.