// NumRequests returns the rolling number of requests
3015
func (d *DefaultMetricCollector) NumRequests() *rolling.Number {
	d.mutex.RLock()
	defer d.mutex.RUnlock()
	return d.numRequests
}
1224879
func (n *NSQRequesterFactory) GetRequester(num uint64) bench.Requester {
	return &nsqRequester{
		url:         n.URL,
		payloadSize: n.PayloadSize,
		topic:       n.Topic + "-" + strconv.FormatUint(num, 10),
		channel:     n.Topic + "-" + strconv.FormatUint(num, 10),
	}
}
1266473
func (c *Client) LimitedRequest(path string, results int) (string, int, error) {
	res, reqErr := c.Request("GET", path+"?limit="+strconv.Itoa(results), nil)

	if reqErr != nil && !IsErrAPIMismatch(reqErr) {
		return "", -1, reqErr
	}

	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)

	if err != nil {
		return "", -1, err
	}

	r := make(map[string]interface{})
	if err = json.Unmarshal([]byte(body), &r); err != nil {
		return "", -1, err
	}

	out, err := json.Marshal(r["results"].([]interface{}))

	if err != nil {
		return "", -1, err
	}

	return string(out), int(r["count"].(float64)), reqErr
}
231136
func HandleResourceRequirements(params map[string]string) (api.ResourceRequirements, error) {
	result := api.ResourceRequirements{}
	limits, err := populateResourceList(params["limits"])
	if err != nil {
		return result, err
	}
	result.Limits = limits
	requests, err := populateResourceList(params["requests"])
	if err != nil {
		return result, err
	}
	result.Requests = requests
	return result, nil
}
337508
func (l *level) numNodes() int {
	num := len(l.nodes)
	if l.pwc != nil {
		num++
	}
	if l.fwc != nil {
		num++
	}
	return num
}
985289
func WmSyncRequestCounter(xu *xgbutil.XUtil, win xproto.Window) (uint, error) {
	return xprop.PropValNum(xprop.GetProperty(xu, win,
		"_NET_WM_SYNC_REQUEST_COUNTER"))
}
216713
func NewRequest(conn Conn, data []byte, offset int) Request {
	return &request{conn: conn, data: data, offset: offset}
}
377145
func (s *Server) numPeers() (int, error) {
	future := s.raft.GetConfiguration()
	if err := future.Error(); err != nil {
		return 0, err
	}

	return autopilot.NumPeers(future.Configuration()), nil
}
779337
func (n *TxNotifier) unspentRequests() []SpendRequest {
	var unspent []SpendRequest
	for spendRequest, spendNtfnSet := range n.spendNotifications {
		// If the notification is already aware of its spend details, or
		// it's in the process of learning them, we'll skip it as we
		// can't yet determine if it's unspent or not.
		if spendNtfnSet.rescanStatus != rescanComplete ||
			spendNtfnSet.details != nil {
			continue
		}

		unspent = append(unspent, spendRequest)
	}

	return unspent
}
91205
func (f *File) NumConns() int {
	f.connsLock.Lock()
	defer f.connsLock.Unlock()

	return len(f.conns)
}
1333043
func DiscardRequests(in <-chan *Request) {
	for req := range in {
		if req.WantReply {
			req.Reply(false, nil)
		}
	}
}
1159065
func incRequests() {
	stats.TotalRequestRate.Mark(1)
	eCtr := float64(stats.ErrorRate.Count())
	rCtr := float64(stats.TotalRequestRate.Count())
	stats.ErrorPercent.Update(eCtr / rCtr * 100)
}
257230
func UpgradeRequests(pattern string, eventHandler EventHandler) {
	http.HandleFunc(pattern, UpgradeHandlerFunc(eventHandler))
}
52676
func (d *AddressCacheItem) NumRows() (int, *BlockID) {
	d.mtx.RLock()
	defer d.mtx.RUnlock()
	if d.rows == nil {
		return -1, nil
	}
	return len(d.rows), d.blockID()
}
727453
func (r *AMQPRequesterFactory) GetRequester(num uint64) bench.Requester {
	return &amqpRequester{
		url:          r.URL,
		payloadSize:  r.PayloadSize,
		queueName:    r.Queue + "-" + strconv.FormatUint(num, 10),
		exchangeName: r.Exchange + "-" + strconv.FormatUint(num, 10),
	}
}
572411
func (a *Account) NumConnections() int {
	a.mu.RLock()
	nc := len(a.clients) + int(a.nrclients)
	a.mu.RUnlock()
	return nc
}
210314
func (a *Account) NumLocalConnections() int {
	a.mu.RLock()
	nlc := a.numLocalConnections()
	a.mu.RUnlock()
	return nlc
}