Skip to content

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

Open
zhaohaihang wants to merge 1 commit into
nsqio:masterfrom
zhaohaihang:fix_statistics_function
Open

nsqd: statistics aren't recorded when client publishes to multiple topics#1497
zhaohaihang wants to merge 1 commit into
nsqio:masterfrom
zhaohaihang:fix_statistics_function

Conversation

@zhaohaihang

Copy link
Copy Markdown

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
Copy Markdown
Author

ready for review

@mreiferson mreiferson left a comment

Copy link
Copy Markdown
Member

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.

Comment thread nsqd/client_v2.go
Topic: topic,
Count: count,
})
break

Copy link
Copy Markdown
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