//see: http://godoc.org/gopkg.in/mgo.v2#Query.Count
435245
func (self *Query) Count() (n int, err error) {

	return self.collection.Find(self.query).Count()
}
420584
func (h *Histogram) Count() (count int64) {
	for i := range h.buckets {
		count += h.buckets[i].Get()
	}
	return
}
435354
func (c *ChannelsHistoryCall) Count(count int) *ChannelsHistoryCall {
	c.count = count
	return c
}
1045278
func (m *GormCommentRepository) Count(ctx context.Context, parentID uuid.UUID) (int, error) {
	defer goa.MeasureSince([]string{"goa", "db", "comment", "query"}, time.Now())
	var count int

	m.db.Model(&Comment{}).Where("parent_id = ?", parentID).Count(&count)

	return count, nil
}
78116
func (p *PostgresProvider) Count() (total int) {
	if err := p.c.QueryRow("SELECT COUNT(*) AS NUM FROM session").Scan(&total); err != nil {
		panic("session/postgres: error counting records: " + err.Error())
	}
	return total
}
241360
func (s *Sublist) Count() uint32 {
	s.RLock()
	defer s.RUnlock()
	return s.count
}
1079068
func (c *collectorImpl) Count() int {
	c.Lock()
	defer c.Unlock()

	return len(c.Flows)
}
1141802
func (p *pathObject) Count() (int64, error) {
	it := p.buildIteratorTree()
	return p.s.countResults(it)
}
1333376
func (s *DB) Count(value interface{}) *DB {
	return s.NewScope(s.Value).count(value).db
}
513367
func (q *Query) Count() (int, error) {
	tx := q.pool.NewTransaction()
	var count int
	newTransactionQuery(q.query, tx).Count(&count)
	if err := tx.Exec(); err != nil {
		return 0, err
	}
	return count, nil
}
320515
func (r *Resource) Count() (int, error) {
	raw := r.RawCount.Value()
	count, ok := r.RawCount.Value().(string)
	if !ok {
		return 0, fmt.Errorf(
			"expected count to be a string or int, got %T", raw)
	}

	v, err := strconv.ParseInt(count, 0, 0)
	if err != nil {
		return 0, fmt.Errorf(
			"cannot parse %q as an integer",
			count,
		)
	}

	return int(v), nil
}
310675
func (mongo *MongoDB) Count() int {
	c, _ := mongo.Collection.Count()
	return c
}
71086
func (ps *PrefixScanner) Count() (count int, err error) {
	pre := ps.Prefix
	err = ps.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(ps.BucketName).Cursor()
		for k, _ := c.Seek(pre); bytes.HasPrefix(k, pre); k, _ = c.Next() {
			count++
		}
		return nil
	})
	if err != nil {
		return count, err
	}
	return count, err
}
356671
func (kv *KV) Count() (i int) {
	kv.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(kv.table).Cursor()
		for k, _ := c.First(); k != nil; k, _ = c.Next() {
			i++
		}
		return nil
	})
	return
}
899849
func (mp *TxPool) Count() int {
	mp.mtx.RLock()
	count := len(mp.pool)
	mp.mtx.RUnlock()

	return count
}
448891
func (m *MockCollector) Count() int {
	ret := m.ctrl.Call(m, "Count")
	ret0, _ := ret[0].(int)
	return ret0
}
715153
func (c *IterateChain) Count() (int64, error) {
	c.start()
	defer c.end()
	if err := c.it.Err(); err != nil {
		return 0, err
	}
	if size, exact := c.it.Size(); exact {
		return size, nil
	}
	done := c.ctx.Done()
	var cnt int64
iteration:
	for c.next() {
		select {
		case <-done:
			break iteration
		default:
		}
		cnt++
		for c.nextPath() {
			select {
			case <-done:
				break iteration
			default:
			}
			cnt++
		}
	}
	return cnt, c.it.Err()
}