summaryrefslogtreecommitdiffstats
path: root/tokio-trace
diff options
context:
space:
mode:
authorJoão Oliveira <hello@jxs.pt>2019-04-05 21:51:20 +0100
committerEliza Weisman <eliza@buoyant.io>2019-04-05 13:51:20 -0700
commit4f819b7cd17782f3090bc50265b5af7314eb20ce (patch)
tree1bc3f87d0b7c652856d60770d5a137923c0ac612 /tokio-trace
parent197f88f3bca4e230ff53b57f45dadf86db3e2cfd (diff)
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
Diffstat (limited to 'tokio-trace')
-rw-r--r--tokio-trace/examples/counters.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio-trace/examples/counters.rs b/tokio-trace/examples/counters.rs
index 45717184..4c5b3583 100644
--- a/tokio-trace/examples/counters.rs
+++ b/tokio-trace/examples/counters.rs
@@ -113,7 +113,7 @@ impl Counters {
fn new() -> (Self, CounterSubscriber) {
let counters = Counters(Arc::new(RwLock::new(HashMap::new())));
let subscriber = CounterSubscriber {
- ids: AtomicUsize::new(0),
+ ids: AtomicUsize::new(1),
counters: counters.clone(),
};
(counters, subscriber)