Skip to content

Commit

Permalink
nsqadmin: update GetNSQDStats API
Browse files Browse the repository at this point in the history
  • Loading branch information
andyxning authored and mreiferson committed Sep 1, 2017
1 parent d0f20d1 commit 9fe3205
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nsqadmin/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (s *httpServer) topicHandler(w http.ResponseWriter, req *http.Request, ps h
s.ctx.nsqadmin.logf(LOG_WARN, "%s", err)
messages = append(messages, pe.Error())
}
topicStats, _, err := s.ci.GetNSQDStats(producers, topicName)
topicStats, _, err := s.ci.GetNSQDStats(producers, topicName, "")
if err != nil {
pe, ok := err.(clusterinfo.PartialErr)
if !ok {
Expand Down Expand Up @@ -291,7 +291,7 @@ func (s *httpServer) channelHandler(w http.ResponseWriter, req *http.Request, ps
s.ctx.nsqadmin.logf(LOG_WARN, "%s", err)
messages = append(messages, pe.Error())
}
_, allChannelStats, err := s.ci.GetNSQDStats(producers, topicName)
_, channelStats, err := s.ci.GetNSQDStats(producers, topicName, channelName)
if err != nil {
pe, ok := err.(clusterinfo.PartialErr)
if !ok {
Expand All @@ -305,7 +305,7 @@ func (s *httpServer) channelHandler(w http.ResponseWriter, req *http.Request, ps
return struct {
*clusterinfo.ChannelStats
Message string `json:"message"`
}{allChannelStats[channelName], maybeWarnMsg(messages)}, nil
}{channelStats[channelName], maybeWarnMsg(messages)}, nil
}

func (s *httpServer) nodesHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params) (interface{}, error) {
Expand Down Expand Up @@ -349,7 +349,7 @@ func (s *httpServer) nodeHandler(w http.ResponseWriter, req *http.Request, ps ht
return nil, http_api.Err{404, "NODE_NOT_FOUND"}
}

topicStats, _, err := s.ci.GetNSQDStats(clusterinfo.Producers{producer}, "")
topicStats, _, err := s.ci.GetNSQDStats(clusterinfo.Producers{producer}, "", "")
if err != nil {
s.ctx.nsqadmin.logf(LOG_ERROR, "failed to get nsqd stats - %s", err)
return nil, http_api.Err{502, fmt.Sprintf("UPSTREAM_ERROR: %s", err)}
Expand Down Expand Up @@ -631,7 +631,7 @@ func (s *httpServer) counterHandler(w http.ResponseWriter, req *http.Request, ps
s.ctx.nsqadmin.logf(LOG_WARN, "%s", err)
messages = append(messages, pe.Error())
}
_, channelStats, err := s.ci.GetNSQDStats(producers, "")
_, channelStats, err := s.ci.GetNSQDStats(producers, "", "")
if err != nil {
pe, ok := err.(clusterinfo.PartialErr)
if !ok {
Expand Down

0 comments on commit 9fe3205

Please sign in to comment.