-
Notifications
You must be signed in to change notification settings - Fork 94
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
Conversation
88167fa
to
9029c48
Compare
relay-server/src/services/outcome.rs
Outdated
1003 => Self::BoostKeyTransactions, | ||
1004 => Self::Recalibration, | ||
1005 => Self::BoostReplayId, | ||
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions, |
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.
Is this 1400 including and 1500 excluding? If yes, then we're good 👍
Same question for BoostLatestReleases and Custom.
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.
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 withstart <= x < end
(docs)
relay-server/src/services/outcome.rs
Outdated
1003 => Self::BoostKeyTransactions, | ||
1004 => Self::Recalibration, | ||
1005 => Self::BoostReplayId, | ||
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions, |
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.
n if (1400..1500).contains(&n) => Self::BoostLowVolumeTransactions, | |
1400..=1499 => Self::BoostLowVolumeTransactions, |
And for the following lines the same.
relay-server/src/services/outcome.rs
Outdated
} | ||
|
||
impl RuleCategory { | ||
fn to_str(self) -> &'static str { |
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.
fn to_str(self) -> &'static str { | |
fn as_str(self) -> &'static str { |
We have as_str
throughout Relay for enums
Reduce noise in outcome reasons by mapping ranges of dynamic sampling rule IDs together, and ordering them. That is