Require all kstat targets to declare their sample limit#10545
Open
bnaecker wants to merge 1 commit into
Open
Conversation
d20d380 to
e405633
Compare
Remove the default per-target sample limit in the `KstatSampler`. Instead, require all targets to declare their own limit after which the sampler starts to drop the oldest samples. This forces every target to right-size its own queue, so that developers need to consider their sampling rates and data cardinality at the time they register. Fixes #10542
e405633 to
d72ed5f
Compare
wfchandler
reviewed
Jun 4, 2026
| /// The maximum cardinality of the data we produce, per sampling interval. | ||
| pub const fn max_cardinality() -> usize { | ||
| // Assume max of 256 CPUs | ||
| CPU_MICROSTATES.len() * 256 |
Contributor
There was a problem hiding this comment.
We're going to exceed 256 CPUs with dense Turin, right? Should we bump this even high in anticipation of that?
Collaborator
Author
There was a problem hiding this comment.
Hmm, yes possibly. I debated making this method detect the actual number of cores. It's just a little more annoying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the default per-target sample limit in the
KstatSampler. Instead, require all targets to declare their own limit after which the sampler starts to drop the oldest samples. This forces every target to right-size its own queue, so that developers need to consider their sampling rates and data cardinality at the time they register.Fixes #10542