mirror of https://github.com/divan/expvarmon.git
Interval display added
This commit is contained in:
parent
1118a04707
commit
bef7cb57db
4
main.go
4
main.go
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
var (
|
||||
interval = flag.Duration("i", 5*time.Second, "Polling interval")
|
||||
portsArg = flag.String("ports", "1234", "Ports for accessing services expvars")
|
||||
varsArg = flag.String("vars", "mem:memstats.Alloc,mem:memstats.Sys", "Default vars to monitor")
|
||||
portsArg = flag.String("ports", "1234", "Ports for accessing services expvars (comma-separated)")
|
||||
varsArg = flag.String("vars", "mem:memstats.Alloc,mem:memstats.Sys", "Vars to monitor (comma-separated)")
|
||||
dummy = flag.Bool("dummy", false, "Use dummy (console) output")
|
||||
)
|
||||
|
||||
|
|
2
ui.go
2
ui.go
|
@ -122,7 +122,7 @@ func (t *TermUI) Init(data UIData) error {
|
|||
|
||||
// Update updates UI widgets from UIData.
|
||||
func (t *TermUI) Update(data UIData) {
|
||||
t.Title.Text = fmt.Sprintf("monitoring %d services, press q to quit", len(data.Services))
|
||||
t.Title.Text = fmt.Sprintf("monitoring %d services every %v, press q to quit", len(data.Services), *interval)
|
||||
t.Status.Text = fmt.Sprintf("Last update: %v", data.LastTimestamp.Format("15:04:05 02/Jan/06"))
|
||||
|
||||
// List with service names
|
||||
|
|
|
@ -77,7 +77,7 @@ func (t *TermUISingle) Update(data UIData) {
|
|||
// single mode assumes we have one service only to monitor
|
||||
service := data.Services[0]
|
||||
|
||||
t.Title.Text = fmt.Sprintf("monitoring %s, press q to quit", service.Name)
|
||||
t.Title.Text = fmt.Sprintf("monitoring %s every %v, press q to quit", service.Name, *interval)
|
||||
t.Status.Text = fmt.Sprintf("Last update: %v", data.LastTimestamp.Format("15:04:05 02/Jan/06"))
|
||||
|
||||
// Sparklines
|
||||
|
|
Loading…
Reference in New Issue