Skip to content

Commit

Permalink
nsqd: cleanup some superfluous comments in http.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Aug 2, 2018
1 parent 581bad4 commit 8c9a66a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions nsqd/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,24 +486,19 @@ func (s *httpServer) doStats(w http.ResponseWriter, req *http.Request, ps httpro
startTime := s.ctx.nsqd.GetStartTime()
uptime := time.Since(startTime)

// If we WERE given a topic-name, remove stats for all the other topics:
// filter by topic (if specified)
if len(topicName) > 0 {
// Find the desired-topic-index:
for _, topicStats := range stats {
if topicStats.TopicName == topicName {
// If we WERE given a channel-name, remove stats for all the other channels:
// filter by channel (if specified)
if len(channelName) > 0 {
// Find the desired-channel:
for _, channelStats := range topicStats.Channels {
if channelStats.ChannelName == channelName {
topicStats.Channels = []ChannelStats{channelStats}
// We've got the channel we were looking for:
break
}
}
}

// We've got the topic we were looking for:
stats = []TopicStats{topicStats}
break
}
Expand Down

0 comments on commit 8c9a66a

Please sign in to comment.