0
0
Fork 0

scorch stats MaxBatchIntroTime and TotBatchIntroTime

This commit is contained in:
Steve Yen 2018-03-02 11:17:16 -08:00
parent 868a66279e
commit d61d9e4cf6
2 changed files with 17 additions and 5 deletions

View File

@ -344,6 +344,8 @@ func (s *Scorch) prepareSegment(newSegment segment.Segment, ids []string,
_ = root.DecRef()
introStartTime := time.Now()
s.introductions <- introduction
// block until this segment is applied
@ -356,6 +358,12 @@ func (s *Scorch) prepareSegment(newSegment segment.Segment, ids []string,
err = <-introduction.persisted
}
introTime := uint64(time.Since(introStartTime))
atomic.AddUint64(&s.stats.TotBatchIntroTime, introTime)
if atomic.LoadUint64(&s.stats.MaxBatchIntroTime) < introTime {
atomic.AddUint64(&s.stats.MaxBatchIntroTime, introTime)
}
return err
}

View File

@ -25,11 +25,15 @@ import (
// and fields that are prefixed like TotXxxx are monotonically
// increasing counters.
type Stats struct {
TotUpdates uint64
TotDeletes uint64
TotBatches uint64
TotBatchesEmpty uint64
TotOnErrors uint64
TotUpdates uint64
TotDeletes uint64
TotBatches uint64
TotBatchesEmpty uint64
TotBatchIntroTime uint64
MaxBatchIntroTime uint64
TotOnErrors uint64
TotAnalysisTime uint64
TotIndexTime uint64