Skip to content

Commit

Permalink
tweak test to avoid unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz committed Apr 15, 2023
1 parent 7e565c5 commit 9c56ae4
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions metrics/tests/macros/03_mod_aliasing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@

pub mod framework {
pub mod metrics {
pub struct Key;
pub struct Label;

macro_rules! register_counter {
($x:expr, $($y:expr),+) => {};
}
pub const UPLOAD_METRIC_NAME: &'static str = "some_metric";
pub const UPLOAD_METRIC_LABEL_SUCCESS: &'static str = "success";
pub const UPLOAD_METRIC_LABEL_PROCESS_TYPE: &'static str = "process_type";
}
}

use framework::*; // This exposes mod `framework::metrics`.

const UPLOAD_METRIC_NAME: &'static str = "some_metric";
const UPLOAD_METRIC_LABEL_SUCCESS: &'static str = "success";
const UPLOAD_METRIC_LABEL_PROCESS_TYPE: &'static str = "process_type";

#[inline]
pub fn register_metrics() {
::metrics::register_counter!(
UPLOAD_METRIC_NAME,
&[(UPLOAD_METRIC_LABEL_PROCESS_TYPE, ""), (UPLOAD_METRIC_LABEL_SUCCESS, ""),]
metrics::UPLOAD_METRIC_NAME,
&[(metrics::UPLOAD_METRIC_LABEL_PROCESS_TYPE, ""), (metrics::UPLOAD_METRIC_LABEL_SUCCESS, ""),]
);
}

Expand Down

0 comments on commit 9c56ae4

Please sign in to comment.