Skip to content

Commit e2b9141

Browse files
authored
Merge pull request #23 from essentialkaos/develop
Version 3.2.0
2 parents 73eb30b + 718b4b5 commit e2b9141

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

common/redis-latency-monitor.spec

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
Summary: Tiny Redis client for latency measurement
1212
Name: redis-latency-monitor
13-
Version: 3.1.1
13+
Version: 3.2.0
1414
Release: 0%{?dist}
1515
Group: Applications/System
1616
License: EKOL
@@ -86,6 +86,9 @@ fi
8686
################################################################################
8787

8888
%changelog
89+
* Mon Oct 21 2019 Anton Novojilov <[email protected]> - 3.2.0-0
90+
- Improved UI
91+
8992
* Thu Oct 17 2019 Anton Novojilov <[email protected]> - 3.1.1-0
9093
- ek package updated to the latest stable version
9194

redis-latency-monitor.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
// App info
3838
const (
3939
APP = "Redis Latency Monitor"
40-
VER = "3.1.1"
40+
VER = "3.2.0"
4141
DESC = "Tiny Redis client for latency measurement"
4242
)
4343

@@ -394,7 +394,14 @@ func formatNumber(value uint64) string {
394394
fv = mathutil.Round(fv, 2)
395395
}
396396

397-
return strings.Replace(fmtutil.PrettyNum(fv), ".", "{s}.", -1) + "{!}"
397+
switch {
398+
case fv >= 100.0:
399+
return "{r}" + fmtutil.PrettyNum(fv) + "{!}"
400+
case fv >= 10.0:
401+
return "{y}" + fmtutil.PrettyNum(fv) + "{!}"
402+
default:
403+
return strings.Replace(fmtutil.PrettyNum(fv), ".", "{s}.", -1) + "{!}"
404+
}
398405
}
399406

400407
// usToMs convert us in uint64 to ms in float64

0 commit comments

Comments
 (0)