| 92 | } |
| 93 | |
| 94 | func (c *changeCache) updateStats(ctx context.Context) { |
| 95 | |
| 96 | c.lock.RLock() |
| 97 | defer c.lock.RUnlock() |
| 98 | if c.db == nil { |
| 99 | return |
| 100 | } |
| 101 | // grab skipped sequence stats |
| 102 | skippedSequenceListStats := c.skippedSeqs.getStats() |
| 103 | |
| 104 | c.db.DbStats.Database().HighSeqFeed.SetIfMax(int64(c.internalStats.highSeqFeed)) |
| 105 | c.db.DbStats.Cache().PendingSeqLen.Set(int64(c.internalStats.pendingSeqLen)) |
| 106 | c.db.DbStats.CBLReplicationPull().MaxPending.SetIfMax(int64(c.internalStats.maxPending)) |
| 107 | c.db.DbStats.Cache().HighSeqStable.Set(int64(c._getMaxStableCached(ctx))) |
| 108 | c.db.DbStats.Cache().NumCurrentSeqsSkipped.Set(skippedSequenceListStats.NumCurrentSkippedSequencesStat) |
| 109 | c.db.DbStats.Cache().NumSkippedSeqs.Set(skippedSequenceListStats.NumCumulativeSkippedSequencesStat) |
| 110 | c.db.DbStats.Cache().SkippedSequenceSkiplistNodes.Set(skippedSequenceListStats.ListLengthStat) |
| 111 | } |
| 112 | |
| 113 | type LogEntry = channels.LogEntry |
| 114 | |