From 0114f247c8986799596b4a66e1ac9383fc457a92 Mon Sep 17 00:00:00 2001 From: Ivan Daniluk Date: Fri, 1 May 2015 19:36:11 +0300 Subject: [PATCH] Sparklines uses first var --- service.go | 2 -- ui_termui.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/service.go b/service.go index 531906a..dc0a052 100644 --- a/service.go +++ b/service.go @@ -5,8 +5,6 @@ import ( "net" "strconv" "strings" - - //"github.com/pyk/byten" ) // Services is just a slice of Service. diff --git a/ui_termui.go b/ui_termui.go index b25f79c..46ceea7 100644 --- a/ui_termui.go +++ b/ui_termui.go @@ -74,7 +74,7 @@ func (t *TermUI) Init(data UIData) error { s := termui.NewSparklines(sparklines...) s.Height = 2*len(data.Services) + 2 s.HasBorder = true - s.Border.Label = "Memory Track" + s.Border.Label = fmt.Sprintf("Sparklines for %s", data.Vars[0]) return s }() @@ -121,7 +121,7 @@ func (t *TermUI) Update(data UIData) { // Sparklines for i, service := range data.Services { t.MemSparkline.Lines[i].Title = service.Name - t.MemSparkline.Lines[i].Data = service.Values("memstats.Alloc") + t.MemSparkline.Lines[i].Data = service.Values(data.Vars[0]) } termui.Body.Width = termui.TermWidth()