// Count returns the number of times Add has been called.
420584
func (h *Histogram) Count() (count int64) {
	for i := range h.buckets {
		count += h.buckets[i].Get()
	}
	return
}
1210046
func (s *sender) Count(stat string, count float64, tags ...string) {
	s.c <- fmt.Sprintf("%s:%f|c\n", stat, count)
}
984279
func (t *txLookup) Count() int {
	t.lock.RLock()
	defer t.lock.RUnlock()

	return len(t.all)
}
238451
func (s *RedisStore) Count(selector string, options *ListOptions) (int, error) {
	allKeys, err := s.Keys(selector, options)
	if err != nil {
		return 0, err
	}
	return len(allKeys), nil
}
802421
func (s sender) Count(stat string, count float64, tags ...string) {
	s.vars.AddFloat(stat, count)
}
3959
func (tu Unit) Count(d time.Duration) (int, error) {
	if d < 0 {
		return 0, errNegativeDuraton
	}

	if dur, found := unitsToDuration[tu]; found {
		return int(d / dur), nil
	}

	// Invalid unit.
	return 0, errUnrecognizedTimeUnit
}
395742
func (cache *Cache) Count() int {
	cache.mutex.RLock()
	count := len(cache.items)
	cache.mutex.RUnlock()
	return count
}
1262200
func (t *tmNodeSeq) Count() int {
	if t.cnt < 0 {
		return sequtil.SeqCount(t)
	}
	return t.cnt
}
251521
func count(s string, b byte) int {
	n := 0
	for i := 0; i < len(s); i++ {
		if s[i] == b {
			n++
		}
	}
	return n
}
1333376
func (s *DB) Count(value interface{}) *DB {
	return s.NewScope(s.Value).count(value).db
}
1361922
func (e *entry) count() int {
	e.mu.RLock()
	n := len(e.values)
	e.mu.RUnlock()
	return n
}
589578
func (c *statsClient) Count(name string, value int64, rate float64) {
	if err := c.client.Count(prefix+name, value, c.tags, rate); err != nil {
		c.logger.Printf("statsd.StatsClient.Count error: %s", err)
	}
}
835657
func (op *op) count() int {
	switch op.typ {
	case 0, 1:
		return 1
	case 2, 3:
		return len(op.values)
	default:
		panic(fmt.Sprintf("unknown operation type: %d", op.typ))
	}
}
1018164
func (c *Counters) Counts() map[string]int64 {
	c.mu.Lock()
	defer c.mu.Unlock()

	counts := make(map[string]int64, len(c.counts))
	for k, v := range c.counts {
		counts[k] = v
	}
	return counts
}
631083
func (c *edgeCollection) Count(ctx context.Context) (int64, error) {
	result, err := c.rawCollection().Count(ctx)
	if err != nil {
		return 0, WithStack(err)
	}
	return result, nil
}
988061
func (ix *Reindexer) count() (int64, error) {
	service := ix.sourceClient.Count(ix.sourceIndex)
	if ix.query != nil {
		service = service.Query(ix.query)
	}
	return service.Do()
}
304317
func (c *Counter) Add(i int) {
	c.Lock()
	c.count += i
	c.Unlock()
}