Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsqadmin: JS error with no clients #642

Merged
merged 4 commits into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions apps/nsq_stat/nsq_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
Expand Down Expand Up @@ -60,23 +59,19 @@ func statLoop(interval time.Duration, topic string, channel string,
ci := clusterinfo.New(nil)
var o *clusterinfo.ChannelStats
for i := 0; !countNum.isSet || countNum.value >= i; i++ {
var producers []string
var producerList clusterinfo.ProducerList
var err error

log.SetOutput(ioutil.Discard)
if len(lookupdHTTPAddrs) != 0 {
producers, err = ci.GetLookupdTopicProducers(topic, lookupdHTTPAddrs)
producerList, err = ci.GetLookupdTopicProducers(topic, lookupdHTTPAddrs)
} else {
producers, err = ci.GetNSQDTopicProducers(topic, nsqdHTTPAddrs)
producerList, err = ci.GetNSQDTopicProducers(topic, nsqdHTTPAddrs)
}
log.SetOutput(os.Stdout)
if err != nil {
log.Fatalf("ERROR: failed to get topic producers - %s", err)
}

log.SetOutput(ioutil.Discard)
_, allChannelStats, err := ci.GetNSQDStats(producers, topic)
log.SetOutput(os.Stdout)
_, allChannelStats, err := ci.GetNSQDStats(producerList, topic)
if err != nil {
log.Fatalf("ERROR: failed to get nsqd stats - %s", err)
}
Expand Down
Loading