MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / updateStats

Method updateStats

db/change_cache.go:94–111  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

92}
93
94func (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
113type LogEntry = channels.LogEntry
114

Calls 9

_getMaxStableCachedMethod · 0.95
RLockMethod · 0.80
RUnlockMethod · 0.80
getStatsMethod · 0.80
CacheMethod · 0.80
CBLReplicationPullMethod · 0.80
SetIfMaxMethod · 0.45
DatabaseMethod · 0.45
SetMethod · 0.45