// Count returns the count of this resource.
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
}
213513
func (m *StandardMeter) Count() int64 {
	m.lock.RLock()
	count := m.snapshot.count
	m.lock.RUnlock()
	return count
}
820655
func (r *BotsService) Count() *BotsCountCall {
	c := &BotsCountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
340471
func (r *Application) Count(count int) *Application {
	r.Instances = &count

	return r
}
1189613
func (pc *ProbabilisticCounter) Count() int {
	ones := float64(pc.bitset.Count())
	length := float64(pc.bitset.Len())
	zeroes := length - ones
	estimator := -1 * length * math.Log(zeroes/length)
	return int(estimator)
}
358856
func (c *Connection) Count(model interface{}) (int, error) {
	return Q(c).Count(model)
}
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)
	}
}
679439
func (m *CountMeter) Count() int64 {
	m.mtx.RLock()
	defer m.mtx.RUnlock()
	return m.overall
}
490070
func (p *FileProvider) Count() int {
	count := 0
	if err := filepath.Walk(p.rootPath, func(path string, fi os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		if !fi.IsDir() {
			count++
		}
		return nil
	}); err != nil {
		log.Printf("error counting session files: %v", err)
		return 0
	}
	return count
}
876585
func (c *counters) Counts() map[string]int64 {
	c.mu.RLock()
	defer c.mu.RUnlock()

	counts := make(map[string]int64, len(c.counts))
	for k, a := range c.counts {
		counts[k] = atomic.LoadInt64(a)
	}
	return counts
}
338342
func (self *Operation) Count() (int64, error) {
	var result int64
	// params := Params{Params: []interface{}{self.Key}}
	params := []interface{}{self.Key}
	if err := self.Call("operation.count", params, &result); err != nil {
		return -1, err
	}
	return result, nil
}
1138331
func (t *Timings) Count() int64 {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.totalCount
}
1132297
func (s *Strobe) Count() int {
	s.lock.Lock()
	defer s.lock.Unlock()
	return len(s.listeners)
}
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))
	}
}
1178641
func (c *Client) Count(indices ...string) *CountService {
	return NewCountService(c).Index(indices...)
}
874413
func (c *Conn) Count() (int, error) {
	code, m, err := c.doRPC("/rpc/status", nil)
	if err != nil {
		return 0, err
	}
	if code != 200 {
		return 0, makeError(m)
	}
	return strconv.Atoi(string(findRec(m, "count").Value))
}
1245638
func (me *Dataset) Count() (int64, error) {
	var count int64
	_, err := me.Select(COUNT(Star()).As("count")).ScanVal(&count)
	return count, err
}