mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Switch to Timing helper function
This commit is contained in:
parent
2423ecf8d5
commit
df2503dfa6
3 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue