| 1943 | } |
| 1944 | |
| 1945 | func (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 | |
| 1954 | func (d *DbStats) Database() *DatabaseStats { |
| 1955 | return d.DatabaseStats |