From 9fe3205a791a46cd97d3d2a8d3301d2b8a5e4bc8 Mon Sep 17 00:00:00 2001 From: Andy Xie Date: Fri, 1 Sep 2017 08:45:03 -0700 Subject: [PATCH] nsqadmin: update GetNSQDStats API --- nsqadmin/http.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nsqadmin/http.go b/nsqadmin/http.go index e1fd2b137..8c60e740d 100644 --- a/nsqadmin/http.go +++ b/nsqadmin/http.go @@ -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 { @@ -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 { @@ -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) { @@ -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)} @@ -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 {