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

Method CollectionStat

base/stats.go:1945–1952  ·  view source on GitHub ↗
(scopeName, collectionName string)

Source from the content-addressed store, hash-verified

1943}
1944
1945func (d *DbStats) CollectionStat(scopeName, collectionName string) (*CollectionStats, error) {
1946 scopeAndCollectionName := scopeName + "." + collectionName
1947 if _, ok := d.CollectionStats[scopeAndCollectionName]; !ok {
1948 // DbStats was not initialised with this collection upfront in NewDBStats for some reason - not something we'd expect to happen
1949 return nil, fmt.Errorf("stats for collection %q not found", scopeAndCollectionName)
1950 }
1951 return d.CollectionStats[scopeAndCollectionName], nil
1952}
1953
1954func (d *DbStats) Database() *DatabaseStats {
1955 return d.DatabaseStats

Callers 3

TestCollectionStatsFunction · 0.80
NewDatabaseContextFunction · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by 2

TestCollectionStatsFunction · 0.64