// Size returns the max size of cache.
545516
func (mc *cache) Size() int {
	mc.mu.Lock()
	defer mc.mu.Unlock()
	return mc.size
}
308806
func (fs *FileSet) Size() int64 {
	var total int64
	for _, f := range fs.files {
		total += f.Size()
	}
	return total + int64(fs.manifestSize)
}
1365314
func (r *Request) Size() int64 {
	return int64(r.context.Request.Header.ContentLength())
}
1031900
func (db *Database) Size() (common.StorageSize, common.StorageSize) {
	db.lock.RLock()
	defer db.lock.RUnlock()

	// db.dirtiesSize only contains the useful data in the cache, but when reporting
	// the total memory consumption, the maintenance metadata is also needed to be
	// counted.
	var metadataSize = common.StorageSize((len(db.dirties) - 1) * cachedNodeSize)
	var metarootRefs = common.StorageSize(len(db.dirties[common.Hash{}].children) * (common.HashLength + 2))
	return db.dirtiesSize + db.childrenSize + metadataSize - metarootRefs, db.preimagesSize
}
1020338
func (s *Set) Size() int {
	// Lock set for read
	s.mutex.RLock()
	defer s.mutex.RUnlock()

	return len(s.m)
}
203849
func (s *S3Storage) Size(filepath string) int64 {
	key, err := s.Key(filepath)

	if err != nil {
		return 0
	}

	return key.Size
}
1067714
func (c *Cache) Len() int {
	c.Lock()
	defer c.Unlock()
	return c.l.Len()
}
972820
func (info *DefaultNodeInfo) Size() int {
	bs, _ := info.Marshal()
	return len(bs)
}
442892
func (t *tsmGeneration) size() uint64 {
	var n uint64
	for _, f := range t.files {
		n += uint64(f.Size)
	}
	return n
}
1069442
func (d *DirtyBlockCacheStandard) Size() int {
	d.lock.RLock()
	defer d.lock.RUnlock()
	return len(d.cache)
}
1305342
func (r *cacheEntry) Size(ctx context.Context, _ chan bool) (int64, error) {
	return int64(len(r.Update.data)), nil
}
393299
func (m *MicroTime) Size() (n int) {
	if m == nil || m.Time.IsZero() {
		return 0
	}
	return m.ProtoMicroTime().Size()
}
1340616
func (s *FileSystemStorage) Size(filepath string) int64 {
	fi, err := os.Stat(s.Path(filepath))
	if err != nil {
		return 0
	}
	return fi.Size()
}
873811
func (n *node) size() int {
	l := 1
	for _, child := range n.children {
		l += child.size()
	}
	return l
}
8930
func (cache *HealthStatusCache) Size() int {
	cache.mu.Lock()
	defer cache.mu.Unlock()
	return len(cache.data)
}
1038408
func (c *Cache) Len() int {
	c.RLock()
	defer c.RUnlock()
	return len(c.cache)
}
991721
func (n *node) size() int {
	sz, elsz := pageHeaderSize, n.pageElementSize()
	for i := 0; i < len(n.inodes); i++ {
		item := &n.inodes[i]
		sz += elsz + len(item.key) + len(item.value)
	}
	return sz
}