// Count sets the value for optional count parameter
435354
func (c *ChannelsHistoryCall) Count(count int) *ChannelsHistoryCall {
	c.count = count
	return c
}
358856
func (c *Connection) Count(model interface{}) (int, error) {
	return Q(c).Count(model)
}
121806
func (kv *KV) Count() (i int) {
	rows, err := kv.db.Query(
		fmt.Sprintf("SELECT COUNT(*) FROM %s LIMIT 1", string(kv.table)),
	)
	if err != nil {
		return
	}
	defer rows.Close()
	if rows.Next() {
		err = rows.Scan(&i)
	}
	return
}
566096
func (p *proxyServer) Count() int {
	p.Lock()
	defer p.Unlock()
	return p.count
}
1141802
func (p *pathObject) Count() (int64, error) {
	it := p.buildIteratorTree()
	return p.s.countResults(it)
}
483769
func (s *UniformSample) Count() int64 {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	return s.count
}
213513
func (m *StandardMeter) Count() int64 {
	m.lock.RLock()
	count := m.snapshot.count
	m.lock.RUnlock()
	return count
}
1079068
func (c *collectorImpl) Count() int {
	c.Lock()
	defer c.Unlock()

	return len(c.Flows)
}
80543
func (o *querySet) Count() (int64, error) {
	return o.orm.alias.DbBaser.Count(o.orm.db, o, o.mi, o.cond, o.orm.alias.TZ)
}
619262
func (c *modelStateCollection) Count() (int, error) {
	return c.WriteCollection.Find(bson.D{{"model-uuid", c.modelUUID}}).Count()
}
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))
	}
}
168143
func (a MultiStatsClient) Count(name string, value int64, rate float64) {
	for _, c := range a {
		c.Count(name, value, rate)
	}
}
428566
func (s MultiSender) Count(stat string, count float64, tags ...string) {
	for _, ss := range s {
		ss.Count(stat, count, tags...)
	}
}
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()
}
319068
func (query Query) Count() (int, error) {
	var out struct {
		Count int
	}

	err := query.Aggregate("count", "*", &out)
	return out.Count, err
}
298242
func Count(str, pattern string) int {
	if pattern == "" || str == "" {
		return 0
	}

	var r rune
	var size int
	var matched bool

	tr := NewTranslator(pattern, "")
	cnt := 0

	for len(str) > 0 {
		r, size = utf8.DecodeRuneInString(str)
		str = str[size:]

		if _, matched = tr.TranslateRune(r); matched {
			cnt++
		}
	}

	return cnt
}
1178641
func (c *Client) Count(indices ...string) *CountService {
	return NewCountService(c).Index(indices...)
}