Checks queue size.
15071
private void checkQueueSize() {
        int queueSize = getQueueSize();
        if (SEND_QUEUE_SIZE_WARNING_THRESHOLD > 0 && queueSize >= SEND_QUEUE_SIZE_WARNING_THRESHOLD) {
            logger.warn("The Gerrit send commands queue contains {} items!"
                    + " Something might be stuck, or your system can't process the commands fast enough."
                    + " Try to increase the number of sending worker threads."
                    + " Current thread-pool size: {}",
                    queueSize, executor.getPoolSize());
            logger.info("Nr of active pool-threads: {}", executor.getActiveCount());
        }
    }
1054709
synchronized int getSize( int priority ) {
    int size = 0;
    for (int i=priority; i<LEVEL; i++) {
      size += priorityQueues.get(i).size();
    }
    return size;
  }
3415
def qsize(self, qname):
        """"""
        if qname in self._queues:
            return self._queues[qname].qsize()
        else:
            raise ValueError(_("queue %s is not defined"), qname)
999674
private E dequeue() {
        int n = size - 1;
        if (n < 0)
            return null;
        else {
            Object[] array = queue;
            E result = (E) array[0];
            E x = (E) array[n];
            array[n] = null;
            Comparator<? super E> cmp = comparator;
            if (cmp == null)
                siftDownComparable(0, x, array, n);
            else
                siftDownUsingComparator(0, x, array, n, cmp);
            size = n;
            return result;
        }
    }
1266919
function( element, queueLength, count ) {
		var queue = element.queue();

		if ( queueLength > 1 ) {
			queue.splice.apply( queue,
				[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
		}
		element.dequeue();
	}
1021426
def check(self, batch_size):
        """"""
        self.increment(batch_size)
        return self.unit_count >= self.config["log_train_every"]
1039258
private int sample(BlockingQueue<Runnable> queue) {
        ArrayList<Runnable> events = new ArrayList<Runnable>(queue);
        eventCount = events.size();
        if (eventCount < threshold) {
            return -1;
        }

        int sampleCount = min(samples, eventCount);
        int actualSampleCount = 0;
        while (actualSampleCount < sampleCount) {
            Runnable runnable = events.get(random.nextInt(eventCount));
            actualSampleCount += sampleRunnable(runnable);
        }

        return actualSampleCount;
    }
426236
def publish_queue_length(self, redis_client, port, db):
        
        for queue in redis_client.smembers('queues'):
            queue_length = redis_client.llen('queue:%s' % queue)
            self.__publish(port, db, queue, queue_length)
314760
public long getMessageCount(String queue){
        try {
            return getQueueControl(queue).getMessageCount();
        } catch (Exception e) {
            throw new AsyncException(e);
        }
    }
1270707
def full(self):
        """"""
        if not self.size: return False
        return len(self.pq) == (self.size + self.removed_count)
542020
public function measuredQueues()
    {
        $queues = (array) $this->connection()->smembers('measured_queues');

        return collect($queues)->map(function ($class) {
            return preg_match('/queue:(.*)$/', $class, $matches) ? $matches[1] : $class;
        })->all();
    }
927445
public int getWorkQueueSize() {
        int size = 0;
        for (Worker worker : workers) {
            size += worker.taskQueue.size();
        }
        return size;
    }
764198
def qsize(self):
        
        if not self.connected:
            raise QueueNotConnectedError("Queue is not Connected")

        try:
            size = self.__db.llen(self._key)
        except redis.ConnectionError as e:
            raise redis.ConnectionError(repr(e))
        return size
527345
public function queueSize(): int {
        if ($this->tail > $this->head) return 0;
        return $this->head - $this->tail;
    }
1043203
public function size($queue = null)
    {
        $queue = $this->getQueue($queue);

        return (int) $this->pheanstalk->statsTube($queue)->current_jobs_ready;
    }
739934
public function size($queue = null)
    {
        return $this->getQueryBuilder()->from($this->table)
            ->where('queue', $this->getQueue($queue))
            ->count();
    }
1338974
def size(cls, crawler):
        """"""
        key = make_key('queue_pending', crawler)
        return unpack_int(conn.get(key))