mirror of https://github.com/divan/expvarmon.git
Error handling improvements
This commit is contained in:
parent
ff6289fe26
commit
8c86e79306
2
main.go
2
main.go
|
@ -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")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue