@@ -89,10 +89,10 @@ func (c *changeCache) updateStats(ctx context.Context) {
89
89
c .db .DbStats .Cache ().PendingSeqLen .Set (int64 (c .internalStats .pendingSeqLen ))
90
90
c .db .DbStats .CBLReplicationPull ().MaxPending .SetIfMax (int64 (c .internalStats .maxPending ))
91
91
c .db .DbStats .Cache ().HighSeqStable .Set (int64 (c ._getMaxStableCached (ctx )))
92
- c .db .DbStats .Cache ().SkippedSeqLen .Set (int64 ( len ( c .skippedSeqs .list ) ))
93
- c .db .DbStats .Cache ().SkippedSeqCap .Set (int64 ( cap ( c .skippedSeqs .list ) ))
94
- c .db .DbStats .Cache ().NumSkippedSeqs .Set (c .skippedSeqs .NumCumulativeSkippedSequences )
95
- c .db .DbStats .Cache ().NumCurrentSeqsSkipped .Set (c .skippedSeqs .NumCurrentSkippedSequences )
92
+ c .db .DbStats .Cache ().SkippedSeqLen .Set (c .skippedSeqs .getSliceLength ( ))
93
+ c .db .DbStats .Cache ().SkippedSeqCap .Set (c .skippedSeqs .getSliceCapacity ( ))
94
+ c .db .DbStats .Cache ().NumSkippedSeqs .Set (c .skippedSeqs .getCumulativeNumSkippedSequenceValue () )
95
+ c .db .DbStats .Cache ().NumCurrentSeqsSkipped .Set (c .skippedSeqs .getNumCurrentSkippedSequenceValue () )
96
96
97
97
}
98
98
@@ -314,7 +314,6 @@ func (c *changeCache) CleanSkippedSequenceQueue(ctx context.Context) error {
314
314
}
315
315
316
316
c .db .DbStats .Cache ().AbandonedSeqs .Add (compactedSequences )
317
- c .skippedSeqs .NumCurrentSkippedSequences -= compactedSequences
318
317
319
318
base .InfofCtx (ctx , base .KeyCache , "CleanSkippedSequenceQueue complete. Cleaned %d sequences from skipped list for database %s." , compactedSequences , base .MD (c .db .Name ))
320
319
return nil
@@ -878,9 +877,6 @@ func (h *LogPriorityQueue) Pop() interface{} {
878
877
879
878
func (c * changeCache ) RemoveSkipped (x uint64 ) error {
880
879
err := c .skippedSeqs .removeSeq (x )
881
- if err == nil {
882
- c .skippedSeqs .NumCurrentSkippedSequences -= 1
883
- }
884
880
return err
885
881
}
886
882
@@ -894,11 +890,7 @@ func (c *changeCache) WasSkipped(x uint64) bool {
894
890
}
895
891
896
892
func (c * changeCache ) PushSkipped (ctx context.Context , startSeq uint64 , endSeq uint64 ) {
897
- newEntry := NewSkippedSequenceRangeEntry (startSeq , endSeq )
898
- numSequences := newEntry .getNumSequencesInEntry ()
899
- c .skippedSeqs .NumCurrentSkippedSequences += numSequences
900
- c .skippedSeqs .NumCumulativeSkippedSequences += numSequences
901
- c .skippedSeqs .PushSkippedSequenceEntry (newEntry )
893
+ c .skippedSeqs .PushSkippedSequenceEntry (NewSkippedSequenceRangeEntry (startSeq , endSeq ))
902
894
}
903
895
904
896
// waitForSequence blocks up to maxWaitTime until the given sequence has been received.
0 commit comments