diff --git a/fragment.go b/fragment.go index b4dc828d1..149749230 100644 --- a/fragment.go +++ b/fragment.go @@ -2249,7 +2249,7 @@ func (f *fragment) Snapshot() error { func track(start time.Time, message string, stats stats.StatsClient, logger logger.Logger) { elapsed := time.Since(start) logger.Debugf("%s took %s", message, elapsed) - stats.Histogram(MetricSnapshotDurationSeconds, elapsed.Seconds(), 1.0) + stats.Timing(MetricSnapshotDurationSeconds, elapsed, 1.0) } // snapshot does the actual snapshot operation. it does not check or care diff --git a/holder.go b/holder.go index 247bce041..51a89826b 100644 --- a/holder.go +++ b/holder.go @@ -801,10 +801,10 @@ func (s *holderSyncer) SyncHolder() error { } } } - s.Stats.Histogram(MetricSyncFieldDurationSeconds, float64(time.Since(tf)), 1.0) + s.Stats.Timing(MetricSyncFieldDurationSeconds, time.Since(tf), 1.0) tf = time.Now() // reset tf } - s.Stats.Histogram(MetricSyncIndexDurationSeconds, float64(time.Since(ti)), 1.0) + s.Stats.Timing(MetricSyncIndexDurationSeconds, time.Since(ti), 1.0) ti = time.Now() // reset ti } diff --git a/server.go b/server.go index 957f45100..ab90bbc9a 100644 --- a/server.go +++ b/server.go @@ -675,7 +675,7 @@ func (s *Server) monitorAntiEntropy() { // Record successful sync in log. s.logger.Printf("holder sync complete") dif := time.Since(t) - s.holder.Stats.Histogram(MetricAntiEntropyDurationSeconds, float64(dif), 1.0) + s.holder.Stats.Timing(MetricAntiEntropyDurationSeconds, dif, 1.0) // Drain tick channel since we just finished anti-entropy. If the AE // process took a long time, we don't want them to pile up on each