Skip to content

Commit

Permalink
Merge pull request #6 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 2.1.0
  • Loading branch information
andyone authored Jun 19, 2017
2 parents c041685 + 9627de5 commit a505ba7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
5 changes: 4 additions & 1 deletion common/redis-latency-monitor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Summary: Tiny Redis client for latency measurement
Name: redis-latency-monitor
Version: 2.0.0
Version: 2.1.0
Release: 0%{?dist}
Group: Applications/System
License: EKOL
Expand Down Expand Up @@ -58,6 +58,9 @@ rm -rf %{buildroot}
###############################################################################

%changelog
* Fri Jun 16 2017 Anton Novojilov <[email protected]> - 2.1.0-0
- Improved UI

* Fri Jun 16 2017 Anton Novojilov <[email protected]> - 2.0.0-0
- Connection latency measurement
- Output measurements in CSV format
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Redis Latency Monitor [![Build Status](https://travis-ci.org/essentialkaos/redis-latency-monitor.svg?branch=master)](https://travis-ci.org/essentialkaos/redis-latency-monitor) [![Go Report Card](https://goreportcard.com/badge/github.com/essentialkaos/redis-latency-monitor)](https://goreportcard.com/report/github.com/essentialkaos/redis-latency-monitor) [![License](https://gh.kaos.io/ekol.svg)](https://essentialkaos.com/ekol)

Tiny Redis client for latency measurement.
Tiny Redis client for latency measurement. Utility show `PING` command latency or connection latency in milliseconds (_one thousandth of a second_).

### Usage demo

[![demo](https://gh.kaos.io/redis-latency-monitor-102.gif)](#usage-demo)
[![demo](https://gh.kaos.io/redis-latency-monitor-210.gif)](#usage-demo)

### Installation

Expand Down
13 changes: 9 additions & 4 deletions redis-latency-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"net"
"os"
"runtime"
"strings"
"time"

"pkg.re/essentialkaos/ek.v9/fmtc"
Expand All @@ -31,7 +32,7 @@ import (

const (
APP = "Redis Latency Monitor"
VER = "2.0.0"
VER = "2.1.0"
DESC = "Tiny Redis client for latency measurement"
)

Expand Down Expand Up @@ -294,10 +295,14 @@ func formatNumber(value float64) string {
}

if value == 0.0 {
return "0.001"
return "0{s-}.001{!}"
}

return fmtutil.PrettyNum(value)
if value > 1000.0 {
value = math.Floor(value)
}

return strings.Replace(fmtutil.PrettyNum(value), ".", "{s-}.", -1) + "{!}"
}

// createOutputTable create and configure output table struct
Expand All @@ -307,7 +312,7 @@ func createOutputTable() *table.Table {
"MEDIAN", "STDDEV", "PERC 95", "PERC 99",
)

t.SetSizes(12, 8, 8, 8, 8, 8, 8, 8)
t.SetSizes(12, 8, 8, 8, 10, 8, 8, 8)

t.SetAlignments(
table.ALIGN_RIGHT, table.ALIGN_RIGHT, table.ALIGN_RIGHT,
Expand Down

0 comments on commit a505ba7

Please sign in to comment.