Log WAL replay duration

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
pull/6926/head
Ganesh Vernekar 5 years ago committed by Julien Pivotto
parent a128fc3534
commit 2cc32c332d
  1. 3
      tsdb/head.go

@ -588,6 +588,7 @@ func (h *Head) Init(minValidTime int64) error {
}
level.Info(h.logger).Log("msg", "replaying WAL, this may take awhile")
start := time.Now()
// Backfill the checkpoint first if it exists.
dir, startFrom, err := wal.LastCheckpoint(h.wal.Dir())
if err != nil && err != record.ErrNotFound {
@ -638,6 +639,8 @@ func (h *Head) Init(minValidTime int64) error {
level.Info(h.logger).Log("msg", "WAL segment loaded", "segment", i, "maxSegment", last)
}
level.Info(h.logger).Log("msg", "WAL replay completed", "duration", time.Since(start).String())
return nil
}

Loading…
Cancel
Save