Skip to content
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

ref(ds): Low cardinality outcome reason #3623

Merged
merged 9 commits into from
May 21, 2024

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented May 17, 2024

Reduce noise in outcome reasons by mapping ranges of dynamic sampling rule IDs together, and ordering them. That is

"123,1004,1500,1403,1404,1000"
# becomes
"1000,1004,1400,1500,?"

@jjbayer jjbayer force-pushed the ref/sampling-low-cardinality-reason branch from 88167fa to 9029c48 Compare May 17, 2024 11:06
1003 => Self::BoostKeyTransactions,
1004 => Self::Recalibration,
1005 => Self::BoostReplayId,
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions,
Copy link
Member

Choose a reason for hiding this comment

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

Is this 1400 including and 1500 excluding? If yes, then we're good 👍
Same question for BoostLatestReleases and Custom.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! I had a more explicit n >= 1400 && n < 1500 condition here first, but the rust linter is very opinionated.

The range start..end contains all values with start <= x < end

(docs)

@jjbayer jjbayer marked this pull request as ready for review May 17, 2024 11:58
@jjbayer jjbayer requested a review from a team as a code owner May 17, 2024 11:58
1003 => Self::BoostKeyTransactions,
1004 => Self::Recalibration,
1005 => Self::BoostReplayId,
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions,
Copy link
Member

@Dav1dde Dav1dde May 17, 2024

Choose a reason for hiding this comment

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

Suggested change
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions,
1400..=1499 => Self::BoostLowVolumeTransactions,

And for the following lines the same.

}

impl RuleCategory {
fn to_str(self) -> &'static str {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fn to_str(self) -> &'static str {
fn as_str(self) -> &'static str {

We have as_str throughout Relay for enums

@jjbayer jjbayer enabled auto-merge (squash) May 17, 2024 12:11
@jjbayer jjbayer merged commit 3aa4991 into master May 21, 2024
22 checks passed
@jjbayer jjbayer deleted the ref/sampling-low-cardinality-reason branch May 21, 2024 09:45
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.

3 participants