Skip to content

Commit

Permalink
use 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
matlockx committed Jun 14, 2019
1 parent c3a33a6 commit 737e6b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metrics_statsd_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewReporter(r metrics.Registry, client *statsd.Client, d time.Duration, opt
r = metrics.DefaultRegistry
}

percentiles := []float64{0.5, 0.75, 0.95, 0.99, 0.999}
percentiles := []float64{0.75, 0.95, 0.99, 0.999}
percentileNames, err := getPercentileNames(percentiles)
if err != nil {
return nil, err
Expand Down Expand Up @@ -116,7 +116,7 @@ func (r *StatsDReporter) FlushOnce() error {
r.Client.Gauge(name+".min", float64(ms.Min()), r.tags, 1)
r.Client.Gauge(name+".mean", ms.Mean(), r.tags, 1)
r.Client.Gauge(name+".stddev", ms.StdDev(), r.tags, 1)
r.Client.Gauge(name+".var", ms.Variance(), r.tags, 1)
r.Client.Gauge(name+".median", time.Duration(ms.Percentile(0.5)).Seconds()*1000, r.tags, 1)

if len(r.percentiles) > 0 {
values := ms.Percentiles(r.percentiles)
Expand All @@ -143,7 +143,7 @@ func (r *StatsDReporter) FlushOnce() error {
r.Client.Gauge(name+".mean", time.Duration(ms.Mean()).Seconds()*1000, r.tags, 1)
r.Client.Gauge(name+".stddev", time.Duration(ms.StdDev()).Seconds()*1000, r.tags, 1)

r.Client.Gauge(name+".median", time.Duration(ms.Percentiles(r.percentiles)[0]).Seconds()*1000, r.tags, 1)
r.Client.Gauge(name+".median", time.Duration(ms.Percentile(0.5)).Seconds()*1000, r.tags, 1)

r.Client.Gauge(name+".rate.1min", ms.Rate1(), r.tags, 1)
r.Client.Gauge(name+".rate.5min", ms.Rate5(), r.tags, 1)
Expand Down

0 comments on commit 737e6b1

Please sign in to comment.