Skip to content

Fix topic statistics source collision for multiple subscriptions#3151

Open
Saigirish23 wants to merge 1 commit into
ros2:humblefrom
Saigirish23:fix/topic-stats-multiple-subscriptions
Open

Fix topic statistics source collision for multiple subscriptions#3151
Saigirish23 wants to merge 1 commit into
ros2:humblefrom
Saigirish23:fix/topic-stats-multiple-subscriptions

Conversation

@Saigirish23
Copy link
Copy Markdown

Description

When multiple subscriptions are created within the same node, their topic statistics messages currently share the same measurement_source_name because only the node name is used when constructing SubscriptionTopicStatistics.

This makes it impossible to distinguish statistics originating from different subscriptions in the same node.

This change includes the subscribed topic name in the generated source identifier by constructing it as:

node_name + topic_name

A regression test has also been added to verify that multiple subscriptions produce distinct measurement_source_name values.

Fixes #2756

Is this user-facing behavior change?

Yes. Topic statistics messages now uniquely identify subscriptions within the same node by including the subscribed topic name in measurement_source_name.

Did you use Generative AI?

Yes. ChatGPT was used for guidance during development and debugging. All code changes, testing, and verification were reviewed and validated manually.

Additional Information

The regression test validates that multiple subscriptions created within the same node produce distinct measurement_source_name values in published statistics messages.

Signed-off-by: Saigirish23 <185754693+Saigirish23@users.noreply.github.com>
@Saigirish23 Saigirish23 force-pushed the fix/topic-stats-multiple-subscriptions branch from 9c24f1d to 167ac31 Compare May 13, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant