From e79e58a0ad93bcb16cf6aeb260812a3fdeadb3cf Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 19 Sep 2018 01:01:56 +0300 Subject: [PATCH 1/2] Code refactoring --- common/redis-monitor-top.spec | 5 ++++- redis-monitor-top.go | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/redis-monitor-top.spec b/common/redis-monitor-top.spec index e2c3f5c..923c5ff 100644 --- a/common/redis-monitor-top.spec +++ b/common/redis-monitor-top.spec @@ -10,7 +10,7 @@ Summary: Tiny Redis client for monitor command output top Name: redis-monitor-top -Version: 1.2.0 +Version: 1.2.1 Release: 0%{?dist} Group: Applications/System License: EKOL @@ -57,6 +57,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Wed Sep 19 2018 Anton Novojilov - 1.2.1-0 +- Code refactoring + * Tue Oct 03 2017 Anton Novojilov - 1.2.0-0 - Fixed bug with processing custom MONITOR command name - Improved float output in RPS diff --git a/redis-monitor-top.go b/redis-monitor-top.go index f862d5f..184e145 100644 --- a/redis-monitor-top.go +++ b/redis-monitor-top.go @@ -33,7 +33,7 @@ import ( const ( APP = "Redis Monitor Top" - VER = "1.2.0" + VER = "1.2.1" DESC = "Tiny Redis client for aggregating stats from MONITOR flow" ) @@ -213,9 +213,7 @@ func printStats() { t.SetSizes(20, 10, 10) t.SetAlignments(table.ALIGN_RIGHT, table.ALIGN_RIGHT, table.ALIGN_RIGHT) - for { - time.Sleep(time.Millisecond * 250) - + for range time.NewTicker(time.Millisecond * 250).C { if time.Since(last) >= interval { renderStats(t) last = time.Now() From 7949b104466eabf19e7750895a88e9c221d7674e Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 19 Sep 2018 15:25:00 +0300 Subject: [PATCH 2/2] Added Golang 1.11 to testing targets --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2f45b6d..de1c860 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ go: - 1.8.x - 1.9.x - 1.10.x + - 1.11.x - tip os: