-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//! This test is to show that we can still use `::metrics::*` macros even though we have imported | ||
//! the `framework::metrics` mod (otherwise, there would be a compilation error). | ||
pub mod framework { | ||
pub mod metrics { | ||
pub struct Key; | ||
pub struct Label; | ||
|
||
macro_rules! register_counter { | ||
($x:expr, $($y:expr),+) => {}; | ||
} | ||
} | ||
} | ||
|
||
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, ""),] | ||
); | ||
} | ||
|
||
fn main() {} |