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

Method updateCalculatedStats

rest/server_context.go:1864–1874  ·  view source on GitHub ↗

Updates stats that are more efficient to calculate at stats collection time

(ctx context.Context)

Source from the content-addressed store, hash-verified

1862
1863// Updates stats that are more efficient to calculate at stats collection time
1864func (sc *ServerContext) updateCalculatedStats(ctx context.Context) {
1865 sc._databasesLock.RLock()
1866 defer sc._databasesLock.RUnlock()
1867 for _, dbContext := range sc._databases {
1868 dbState := atomic.LoadUint32(&dbContext.State)
1869 if dbState == db.DBOnline {
1870 dbContext.UpdateCalculatedStats(ctx)
1871 }
1872 }
1873
1874}
1875
1876// initializeGoCBAgent Obtains a gocb agent from the current server connection. Requires the agent to be closed after use.
1877// Uses retry loop

Callers 1

logStatsMethod · 0.95

Calls 3

RLockMethod · 0.80
RUnlockMethod · 0.80
UpdateCalculatedStatsMethod · 0.80

Tested by

no test coverage detected