Skip to content

Commit

Permalink
Merge pull request #700 from zachbadgett/nsqd_stats_latency_fix
Browse files Browse the repository at this point in the history
nsqd: stats call times out requests during high load
  • Loading branch information
jehiah committed Dec 31, 2015
2 parents eb41723 + f6e5a6e commit 0bec55b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nsqd/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,14 @@ func (c ChannelsByName) Less(i, j int) bool { return c.Channels[i].name < c.Chan

func (n *NSQD) GetStats() []TopicStats {
n.RLock()
defer n.RUnlock()

realTopics := make([]*Topic, 0, len(n.topicMap))
for _, t := range n.topicMap {
realTopics = append(realTopics, t)
}
sort.Sort(TopicsByName{realTopics})

topics := make([]TopicStats, 0, len(n.topicMap))
n.RUnlock()
for _, t := range realTopics {
t.RLock()

Expand Down

0 comments on commit 0bec55b

Please sign in to comment.