From bef7cb57dbc4156dc0233782ae5adac79dca7377 Mon Sep 17 00:00:00 2001 From: Ivan Daniluk Date: Sat, 2 May 2015 22:54:00 +0300 Subject: [PATCH] Interval display added --- main.go | 4 ++-- ui.go | 2 +- ui_single.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 43f565a..532ee5b 100644 --- a/main.go +++ b/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") ) diff --git a/ui.go b/ui.go index 500e221..80f3745 100644 --- a/ui.go +++ b/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 diff --git a/ui_single.go b/ui_single.go index 8492206..5d2b739 100644 --- a/ui_single.go +++ b/ui_single.go @@ -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