// Len returns the number of samples currently in the Buffer.
191858
func (b *Buffer) Len() int {
	return len(b.data) / b.f.Width()
}
1237041
func (b *ByteBuffer) Len() int {
	b.Lock()
	defer b.Unlock()
	return b.b.Len()
}
566166
func (db *Database) Len(sid string) (n int) {
	db.Service.View(func(tx *bolt.Tx) error {
		b := db.getBucketForSession(tx, sid)
		if b == nil {
			return nil
		}

		n = b.Stats().KeyN
		return nil
	})

	return
}
970101
func (d *DB) Len() (num int) {
	d.db.View(func(tx *bolt.Tx) error {

		// Assume bucket exists and has keys
		b := tx.Bucket(tableURLs)
		if b == nil {
			return nil
		}

		b.ForEach(func([]byte, []byte) error {
			num++
			return nil
		})
		return nil
	})
	return
}
407972
func Len(v int32) int {
	u := uint32(v)
	switch {
	case u < 0x80:
		return 1
	case u < 0x4000:
		return 2
	case u < 0x200000:
		return 3
	case u < 0x10000000:
		return 4
	default:
		return 5
	}
}
538008
func (t *Tree) Len() int {
	if t.root != nil {
		return t.root.size
	}
	return 0
}
1367943
func (tx *Tx) Len() (int, error) {
	if tx.db == nil {
		return 0, ErrTxClosed
	}
	return tx.db.keys.Len(), nil
}
391463
func (t *deducerTrie) Len() int {
	t.RLock()
	defer t.RUnlock()
	return t.t.Len()
}
398071
func (rb *ringBuffer) Len() int {
	l := 0
	current := rb.start
	for current.used {
		l++
		current = current.next
		if current == rb.start {
			break
		}
	}
	return l
}
634708
func (c *Cache) Len() int {
	if !c.nolock {
		c.mu.Lock()
		defer c.mu.Unlock()
	}
	return c.ll.Len()
}
1371643
func (s *Stack) Len() int {
	return int(atomic.LoadUint32(s.head) & unlockMask)
}
1370008
func (c *TwoQueueCache) Len() int {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.recent.Len() + c.frequent.Len()
}
912714
func (tb *LTable) Len() int {
	if tb.array == nil {
		return 0
	}
	var prev LValue = LNil
	for i := len(tb.array) - 1; i >= 0; i-- {
		v := tb.array[i]
		if prev == LNil && v != LNil {
			return i + 1
		}
		prev = v
	}
	return 0
}
1272768
func Len(v int64) int {
	u := uint64(v)
	switch {
	case u < 0x80:
		return 1
	case u < 0x4000:
		return 2
	case u < 0x200000:
		return 3
	case u < 0x10000000:
		return 4
	case u < 0x800000000:
		return 5
	case u < 0x40000000000:
		return 6
	case u < 0x2000000000000:
		return 7
	case u < 0x100000000000000:
		return 8
	default:
		return 9
	}
}
1331417
func (e *EndpointSet) Len() int {
	e.mutex.RLock()
	defer e.mutex.RUnlock()
	return len(e.endpoints)
}
882428
func (lru *LRUCache) Len() int {
	lru.lock.RLock()
	defer lru.lock.RUnlock()
	return lru.order.Len()
}
34233
func (p *Prefix) Len() int {
	l, _ := p.Mask.Size()
	return l
}