Skip to content

Commit e01faab

Browse files
committed
Do not report per_link metric without per-link data
1 parent c8db8b9 commit e01faab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commons/zenoh-stats/src/family.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ impl<
301301
}
302302
}
303303
}
304-
if COLLECT_PER_LINK.get() {
304+
if COLLECT_PER_LINK.get()
305+
&& collected
306+
.values()
307+
.flat_map(|(_, transports)| transports)
308+
.any(|t| !t.links.is_empty())
309+
{
305310
let per_link = format!("{name}_per_link", name = self.name);
306311
let mut metric_encoder = encoder.encode_descriptor(
307312
&per_link,

0 commit comments

Comments
 (0)