Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsqd: statistics aren't recorded when client publishes to multiple topics #1497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhaohaihang
Copy link

fix #1492

  • When a client sends messages to multiple topics, the statistics information can only output the results of one topic for a single client.

* When a client sends messages to multiple topics, the statistics information can only output the results of one topic for a single client.
@zhaohaihang zhaohaihang changed the title nsqd: Fix an issue where a client sending messages to multiple topics is unable to aggregate statistics for all topics #1492 nsqd: Fix an issue where a client sending messages to multiple topics is unable to aggregate statistics for all topics Sep 2, 2024
@zhaohaihang
Copy link
Author

ready for review

Copy link
Member

@mreiferson mreiferson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through the code in more detail, there's another bug (I think) that will break with this fix.

https://github.com/nsqio/nsq/blob/master/nsqd/stats.go#L154 needs to be t rather than topic.

@@ -302,7 +302,6 @@ func (c *clientV2) Stats(topicName string) ClientStats {
Topic: topic,
Count: count,
})
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep the break when topicName is not empty.

@mreiferson mreiferson changed the title nsqd: Fix an issue where a client sending messages to multiple topics is unable to aggregate statistics for all topics nsqd: statistics aren't recorded when client publishes to multiple topics Oct 6, 2024
@mreiferson mreiferson added the bug label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nsqd: statistics aren't recorded when client publishes to multiple topics
2 participants