Skip to content

Move FreeBSD/DragonflyBSD out of meminfo add kvm.#547

Merged
SuperQ merged 4 commits into
prometheus:masterfrom
derekmarcotte:dm-kvm
Jan 4, 2018
Merged

Move FreeBSD/DragonflyBSD out of meminfo add kvm.#547
SuperQ merged 4 commits into
prometheus:masterfrom
derekmarcotte:dm-kvm

Conversation

@derekmarcotte

Copy link
Copy Markdown
Contributor

This gives us memory_swap_used_bytes, and everything under one roof.

@SuperQ

SuperQ commented Apr 12, 2017

Copy link
Copy Markdown
Member

Please rebase against master to pick up the fixes for the test pipeline and fix merge conflicts.

Comment thread collector/memory_bsd.go Outdated

@discordianfish discordianfish Jun 8, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typos: memory, usage

@discordianfish

Copy link
Copy Markdown
Member

Looks good beside the typos. I'd try to avoid CGO where possible but overall this seems reasonable.

@mdlayher mdlayher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread collector/kvm_bsd.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll also want to guard this boolean with the mutex.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mguegan

mguegan commented Oct 22, 2017

Copy link
Copy Markdown

Nice, maybe you should see #710 and modify the buffer_bytes part (adding dataType).

@mguegan mguegan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #710

Comment thread collector/memory_bsd.go Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal :
dataType: bsdSysctlTypeUint64,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up. Will rebase on master when #710 is solved.

@discordianfish

Copy link
Copy Markdown
Member

@derekmarcotte #710 is solved. Can you rebase this? Then I think we can finally merge it.

@derekmarcotte

Copy link
Copy Markdown
Contributor Author

@discordianfish Fantastic, thanks! FWIW, 6f0915f is rebased on master, and includes the changes from #710.

@discordianfish discordianfish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ

SuperQ commented Nov 2, 2017

Copy link
Copy Markdown
Member

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.

@derekmarcotte

Copy link
Copy Markdown
Contributor Author

@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.

@discordianfish

Copy link
Copy Markdown
Member

I'd say let's rebase this and get it merged, we can still add tests later.

@derekmarcotte

Copy link
Copy Markdown
Contributor Author

Rebased as of 6be0f84

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ
SuperQ merged commit 477fe46 into prometheus:master Jan 4, 2018
@derekmarcotte
derekmarcotte deleted the dm-kvm branch January 4, 2018 11:33
@mguegan mguegan mentioned this pull request Jan 4, 2018
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* 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.
tamcore pushed a commit to gitgrave/node_exporter that referenced this pull request Oct 22, 2024
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>
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.

5 participants