Error handling improvements

This commit is contained in:
Ivan Daniluk 2015-04-21 17:59:28 +03:00
parent ff6289fe26
commit 8c86e79306
2 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import (
var ( var (
interval = flag.Duration("i", 1*time.Second, "Polling interval") interval = flag.Duration("i", 1*time.Second, "Polling interval")
portsArg = flag.String("ports", "40001,40002,40000,40004", "Ports for accessing services expvars") portsArg = flag.String("ports", "40001,40002,40000,40004,1233,1234,1235", "Ports for accessing services expvars")
dummy = flag.Bool("dummy", false, "Use dummy (console) output") dummy = flag.Bool("dummy", false, "Use dummy (console) output")
) )

View File

@ -67,7 +67,9 @@ func (t *TermUI) Update(data Data) {
var totalAlloc int64 var totalAlloc int64
for _, service := range data.Services { for _, service := range data.Services {
if service.Err != nil { if service.Err != nil {
names.Items = append(names.Items, fmt.Sprintf("[E] %s failed", service.Name)) names.Items = append(names.Items, fmt.Sprintf("[ERR] %s failed", service.Name))
meminfo.Items = append(meminfo.Items, "N/A")
goroutines.Items = append(goroutines.Items, "N/A")
continue continue
} }
alloc := byten.Size(int64(service.Memstats.Alloc)) alloc := byten.Size(int64(service.Memstats.Alloc))