mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
* feat(metrics): `Metrics` derive macro * rename metrics to metrics-derive * use fully qualified fmt path * metric vec with capacity * favor metrics over simple scope attr, simplify code * pull metric description from doc comment * rm debug log * add more docs and sample usage * link to metrics macros * add tests for metrics derive macro * clippy * simplify path comparison * cleanup * remove unused dep * rename stage metrics
25 lines
446 B
Rust
25 lines
446 B
Rust
extern crate reth_metrics_derive;
|
|
use reth_metrics_derive::Metrics;
|
|
|
|
fn main() {}
|
|
|
|
#[derive(Metrics)]
|
|
#[metrics()]
|
|
struct CustomMetrics;
|
|
|
|
#[derive(Metrics)]
|
|
#[metrics(scope = value)]
|
|
struct CustomMetrics2;
|
|
|
|
#[derive(Metrics)]
|
|
#[metrics(scope = 123)]
|
|
struct CustomMetrics3;
|
|
|
|
#[derive(Metrics)]
|
|
#[metrics(scope = "some.scope", scope = "another.scope")]
|
|
struct CustomMetrics4;
|
|
|
|
#[derive(Metrics)]
|
|
#[metrics(random = "value")]
|
|
struct CustomMetrics5;
|