Returns the total number of queued jobs on the queue
340839
def size(self):
        

        if self.id.endswith("/"):
            return sum(Queue(q).size() for q in self.get_known_subqueues())

        # ZSET
        if self.is_sorted:
            return context.connections.redis.zcard(self.redis_key)
        # SET
        elif self.is_set:
            return context.connections.redis.scard(self.redis_key)
        # LIST
        else:
            return context.connections.redis.llen(self.redis_key)
710841
def get_queue_for_job(self, job):
        
        if self._queue is not None:
            return self._queue
        key = '{0}{1}'.format(self.queue_class.redis_queue_namespace_prefix,
                              job.origin)
        return self.queue_class.from_queue_key(
                key, connection=self.connection, job_class=self.job_class)
1280232
public int getTotalValidWaitingOperationCount() {
        int count = 0;
        for (WaitSet waitSet : waitSetMap.values()) {
            count += waitSet.totalValidWaitingOperationCount();
        }
        return count;
    }
101227
public function getQueues()
    {
        // Format the output to suit
        $queues = [];
        foreach ($this->queue->getQueues() as $queue) {
            $queues[] = $queue->name;
        }
        return $queues;
    }
1305710
def count(self):
		
		result = 0
		for tasks in self.__registry.values():
			result += len(tasks)
		return result
1077919
def queue_size(self):
        
        response = self._request("tasks/list")
        tasks = json.loads(response.content.decode('utf-8'))["tasks"]

        return len([t for t in tasks if t['status'] == 'pending'])
16183
def get_jobs_to_queue(self, with_times=False):
        
        return self.get_jobs(to_unix(datetime.utcnow()), with_times=with_times)
402481
@Override
    public int getNumberOfJobs() throws JobPersistenceException {
        return  doWithLock(new LockCallback<Integer>() {
            @Override
            public Integer doWithLock(JedisCommands jedis) throws JobPersistenceException {
                return storage.getNumberOfJobs(jedis);
            }
        }, "Could not get number of jobs.");
    }
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
88223
public long getTaskCount() {
        final ReentrantLock mainLock = this.mainLock;
        mainLock.lock();
        try {
            long n = completedTaskCount;
            for (Worker w : workers) {
                n += w.completedTasks;
                if (w.isLocked())
                    ++n;
            }
            return n + workQueue.size();
        } finally {
            mainLock.unlock();
        }
    }
620484
public function getAvailableJobsForQueueCount($jobQueue)
    {
        $result = $this->_em->createQuery('SELECT j.queue FROM JMSJobQueueBundle:Job j WHERE j.state IN (:availableStates) AND j.queue = :queue')
            ->setParameter('availableStates', [Job::STATE_RUNNING, Job::STATE_NEW, Job::STATE_PENDING])
            ->setParameter('queue', $jobQueue)
            ->setMaxResults(1)
            ->getOneOrNullResult();

        return \count($result);
    }
137209
def num_workers(self):
        
        size = ctypes.c_int()
        check_call(_LIB.MXKVStoreGetGroupSize(self.handle, ctypes.byref(size)))
        return size.value
798598
def list_current_jobs(self):
        
        jobs = {}
        for job in self.scheduler.get_jobs():
            if job.name not in ('schedule_jobs', 'process_status_queue'):
                jobs[job.name] = job

        return jobs
953499
int waitingThreadsCount() {
		int result = 0;
		for (final CountingLock lock : key2lock.values()) {
			result += lock.getQueueLength();
		}
		return result;
	}
527952
public function stats() {
		$this->out('Jobs currently in the queue:');

		$types = $this->QueuedJobs->getTypes()->toArray();
		foreach ($types as $type) {
			$this->out('      ' . str_pad($type, 20, ' ', STR_PAD_RIGHT) . ': ' . $this->QueuedJobs->getLength($type));
		}
		$this->hr();
		$this->out('Total unfinished jobs: ' . $this->QueuedJobs->getLength());
		$this->out('Running workers (processes): ' . $this->QueueProcesses->findActive()->count());
		$this->out('Server name: ' . $this->QueueProcesses->buildServerString());
		$this->hr();
		$this->out('Finished job statistics:');
		$data = $this->QueuedJobs->getStats();
		foreach ($data as $item) {
			$this->out(' ' . $item['job_type'] . ': ');
			$this->out('   Finished Jobs in Database: ' . $item['num']);
			$this->out('   Average Job existence    : ' . str_pad(Number::precision($item['alltime']), 8, ' ', STR_PAD_LEFT) . 's');
			$this->out('   Average Execution delay  : ' . str_pad(Number::precision($item['fetchdelay']), 8, ' ', STR_PAD_LEFT) . 's');
			$this->out('   Average Execution time   : ' . str_pad(Number::precision($item['runtime']), 8, ' ', STR_PAD_LEFT) . 's');
		}
	}
1074281
def count(self):
        
        self.log.info("Running 'count'")
        retvals = {}

        # Numbers of 'tasks'
        num_tasks = self._count_tasks()
        retvals['num_tasks'] = num_tasks

        # Numbers of 'files'
        num_files = self._count_repo_files()
        retvals['num_files'] = num_files

        return retvals
1223745
@VisibleForTesting
    public int getCurrentTaskCount() {
        synchronized (this.queue) {
            int size = this.queue.size() + this.filterQueue.size();
            if (size > 0) {
                // Some tasks may have completed, but we haven't yet been able to clean them up.
                size -= this.queue.values().stream().filter(CompletableFuture::isDone).count();
                size -= this.filterQueue.values().stream().filter(CompletableFuture::isDone).count();
            }

            return size;
        }
    }