mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
trace: fix counters example, Span IDs must be greater than zero (#1037)
## Motivation tokio-trace counter example was panicking due to returning 0 as the first Span Id ## Solution start ID's with 1 instead
This commit is contained in:
parent
197f88f3bc
commit
4f819b7cd1
@ -113,7 +113,7 @@ impl Counters {
|
|||||||
fn new() -> (Self, CounterSubscriber) {
|
fn new() -> (Self, CounterSubscriber) {
|
||||||
let counters = Counters(Arc::new(RwLock::new(HashMap::new())));
|
let counters = Counters(Arc::new(RwLock::new(HashMap::new())));
|
||||||
let subscriber = CounterSubscriber {
|
let subscriber = CounterSubscriber {
|
||||||
ids: AtomicUsize::new(0),
|
ids: AtomicUsize::new(1),
|
||||||
counters: counters.clone(),
|
counters: counters.clone(),
|
||||||
};
|
};
|
||||||
(counters, subscriber)
|
(counters, subscriber)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user