mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(metrics): Add describe() calls to metrics (#1141)
Co-authored-by: lambdaclass-user <github@lambdaclass.com>
This commit is contained in:
committed by
GitHub
parent
c63f5ff942
commit
d050e47a8a
@ -66,6 +66,8 @@ pub(crate) fn derive(node: &DeriveInput) -> Result<proc_macro2::TokenStream> {
|
||||
quote! {
|
||||
impl Default for #ty {
|
||||
fn default() -> Self {
|
||||
#ty::describe();
|
||||
|
||||
Self {
|
||||
#(#defaults)*
|
||||
}
|
||||
@ -127,6 +129,8 @@ pub(crate) fn derive(node: &DeriveInput) -> Result<proc_macro2::TokenStream> {
|
||||
impl #ty {
|
||||
/// Create new instance of metrics with provided scope.
|
||||
#vis fn new(scope: &str) -> Self {
|
||||
#ty::describe(scope);
|
||||
|
||||
Self {
|
||||
#(#defaults)*
|
||||
}
|
||||
@ -147,7 +151,6 @@ pub(crate) fn derive(node: &DeriveInput) -> Result<proc_macro2::TokenStream> {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Ok(quote! {
|
||||
#register_and_describe
|
||||
|
||||
|
||||
Reference in New Issue
Block a user