scorch stats MaxBatchIntroTime and TotBatchIntroTime
This commit is contained in:
parent
868a66279e
commit
d61d9e4cf6
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue