Skip to content

Commit

Permalink
Fix off-by-one, better example
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Mar 20, 2018
1 parent 7a616d9 commit 43b0dea
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.0.0
VERSION = 1.0.1

APP := tcp-time
PACKAGES := $(shell go list -f {{.Dir}} ./...)
Expand Down
51 changes: 33 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,59 @@ Usage of tcp-time:
## Example

```bash
$ tcp-time -n 1000 | jq .
$ tcp-time -target github.com:443 -n 1000 | jq .
{
"Measurements": [
{
"Valid": true,
"Duration": 40605393
"Duration": 137026172
},
{
"Valid": true,
"Duration": 35469927
"Duration": 137579594
},
{
"Valid": true,
"Duration": 138099878
},
# ...
],
"Summary": {
"All": {
"Mean": 36694356.154,
"StdDev": 31847099.84842516,
"Quantiles": [ 32873052, 34962729, 36098973, 37387095, 89838530 ],
"Mean": 127847627.927,
"StdDev": 3758632.3347467924,
"Quantiles": [
117717262,
125723549,
127955884,
129484843,
159901839
],
"Histogram": [
{
"Label": "32.873052ms",
"Value": 32873052,
"Count": 990
"Label": "117.717262ms",
"Value": 117717262,
"Count": 293
},
{
"Label": "47.114421ms",
"Value": 47114421,
"Count": 2
"Label": "126.154177ms",
"Value": 126154177,
"Count": 684
},
{
"Label": "61.355791ms",
"Value": 61355791,
"Count": 2
"Label": "134.591093ms",
"Value": 134591093,
"Count": 20
},
{
"Label": "143.028008ms",
"Value": 143028008,
"Count": 1
},
{
"Label": "75.597161ms",
"Value": 75597161,
"Count": 6
"Label": "151.464924ms",
"Value": 151464924,
"Count": 2
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tcp-time/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func makeDistribution(x []float64) (out distribution) {
for _, q := range quantiles {
out.Quantiles = append(out.Quantiles, stat.Quantile(q, 1, x, nil))
}
dividers := make([]float64, config.HistogramBins)
dividers := make([]float64, config.HistogramBins+1)
min := floats.Min(x)
max := floats.Max(x)
floats.Span(dividers, min, max+1)
Expand Down

0 comments on commit 43b0dea

Please sign in to comment.