-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
pelikan-net: make metrics opt-in #130
Conversation
Changes the way metrics are included in pelikan-net, moving them behind a feature flag to make them opt-in.
@thinkingfish pointed me to this PR. Here's a suggestion that lets you cut down on needing to have #[cfg(feature = "metrics")]
macro_rules! metrics {
{ $( $tt:tt )* } => { $( $tt )* }
}
#[cfg(not(feature = "metrics"))]
macro_rules! metrics {
{ $( $tt:tt)* } => {}
} Then, later on, instead of using metrics! {
METRIC.increment();
} You still have to modify all the calls but you don't have to repeat |
Not a bad idea! |
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.
LGTM.
Changes the way metrics are included in pelikan-net, moving them behind a feature flag to make them opt-in.