Counts the number of requests that have been completed since reboot
@return
@author tpm
767814
public synchronized long getNumberOfRequestsInState(int requiredState)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfRequestsInState", Integer.valueOf(requiredState));

    //Count the number of tick range objects that are in the
    //specified state
    long requestCount=0;

    // Initial range in stream is always completed Range
    stream.setCursor(0);
    // skip this and move to next range
    stream.getNext();
    // Get the first TickRange after completed range and move cursor to the next one
    TickRange tr = stream.getNext();
    // Iterate until we reach final Unknown range
    while (tr.endstamp < RangeList.INFINITY)
    {
      if((tr.type == requiredState) )
      {
        requestCount++;
      }
      tr = stream.getNext();
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getNumberOfRequestsInState", Long.valueOf(requestCount));
    return requestCount;
  }
829588
public long getInvocationCacheMissCount()
  {
    LruCache<Object,I> invocationCache = _invocationCache;

    if (invocationCache != null) {
      return invocationCache.getMissCount();
    }
    else {
      return 0;
    }
  }
900627
public synchronized ConMgrStats getStats ()
    {
        // fill in our snapshot values
        _stats.connectionCount = _connections.size();
        _stats.handlerCount = _handlers.size();
        _stats.deathQueueSize = _deathq.size();
        _stats.outQueueSize = _outq.size();
        if (_oflowqs.size() > 0) {
            _stats.overQueueSize = 0;
            for (OverflowQueue oq : _oflowqs.values()) {
                _stats.overQueueSize += oq.size();
            }
        }
        return _stats.clone();
    }
1012646
public int getRegisteredResourceRequestCount(K key) {
        if(requestQueueMap.containsKey(key)) {
            Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key);
            // FYI: .size() is not constant time in the next call. ;)
            if(requestQueue != null) {
                return requestQueue.size();
            }
        }
        return 0;
    }
96495
public function getForeverCount(){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_FOREVER_COUNT_URL.'access_token='.$this->access_token);
        if ($result)
        {
            $json = json_decode($result,true);
            if (isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
396495
public long getNumberOfCurrentRequests()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfCurrentRequests");
    //request, value, rejected and accepted messages are all counted
    long returnValue = _aoStream.getNumberOfRequestsInState(TickRange.Requested);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Value);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Rejected);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Accepted);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getNumberOfCurrentRequests", new Long(returnValue));
    return returnValue;     
  }
862733
def count(request_criteria)
      return if ::ServiceMock.disable_stubs
      yield self if block_given?
      JSON.parse(http.post('/__admin/requests/count', request_criteria).body)['count']
    end
159298
public int getActiveCount() {
        final ReentrantLock mainLock = this.mainLock;
        mainLock.lock();
        try {
            int n = 0;
            for (Worker w : workers)
                if (w.isLocked())
                    ++n;
            return n;
        } finally {
            mainLock.unlock();
        }
    }
1086068
final public int getConnectionCount() {
		int total = 0;
		synchronized(poolLock) {
			for(PooledConnection<C> pooledConnection : allConnections) {
				if(pooledConnection.connection!=null) total++;
			}
		}
		return total;
	}
1030385
private int countTasksShouldPreempt() {
    int tasksToPreempt = 0;
    long now = ClusterManager.clock.getTime();
    for (PoolGroupSchedulable poolGroup : poolGroupManager.getPoolGroups()) {
      for (PoolSchedulable pool : poolGroup.getPools()) {
        if (pool.isStarving(now)) {
          tasksToPreempt +=
            Math.min(pool.getPending(), pool.getShare() - pool.getGranted());
        }
      }
    }
    return tasksToPreempt;
  }
780945
synchronized public void check() {
		if(lastCheckpoint < 0) {
			lastCheckpoint = System.currentTimeMillis();
		}
		
		requests++;
		long interval = System.currentTimeMillis() - lastCheckpoint;
		if(requests >= maxRequests) {
			try {
				long sleepTime = minInterval - interval;
				if(sleepTime > 0) {
					logger.info("Request limit reached. Wait for " + sleepTime/1000 + " seconds");
					Thread.sleep(sleepTime);
				}
			} catch (InterruptedException e) {
				logger.error(e.getMessage());
				return;
			}
			finally {
				requests = 0;
				lastCheckpoint = System.currentTimeMillis();
			}
		}
		else if(interval > minInterval) {
			requests = 0;
			lastCheckpoint = System.currentTimeMillis();
		}
	}
1188994
public function countUngenerated()
    {
        $query = $this->createQuery();
        $query->matching($query->logicalAnd($query->equals('resource', null), $query->equals('staticResource', null)));
        return $query->count();
    }
1368936
def count(self):
        
        params = self.dump()
        params['limit'] = 0
        params['count'] = 1
        content = self._do_request(params)
        return content['count']
565713
public function getProcessorCount()
    {
        $count = 0;
        foreach ($this->data['actions'] as $action) {
            if (isset($action['processors'])) {
                $count += count($action['processors']);
            }
        }

        return $count;
    }
1158546
public int completed(InetAddress request)
    {
        String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(request);
        Queue<InetAddress> requests = requestsByDatacenter.get(dc);
        assert requests != null;
        assert request.equals(requests.peek());
        requests.poll();
        if (!requests.isEmpty())
            processor.process(requests.peek());
        return --remaining;
    }
329296
public int getCount() throws InterruptedException, KeeperException {
        return ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt();
    }
1176184
public int getCount() {
        Lock lock = this.lock.readLock();
        lock.lock();
        try {
            return this.count;
        } finally {
            lock.unlock();
        }
    }