MCPcopy Create free account
hub / github.com/closeio/tasktiger / get_queue_sizes

Method get_queue_sizes

tasktiger/tasktiger.py:477–490  ·  view source on GitHub ↗

Get the queue's number of tasks in each state. Returns dict with queue size for the QUEUED, SCHEDULED, and ACTIVE states. Does not include size of error queue.

(self, queue: str)

Source from the content-addressed store, hash-verified

475 return task
476
477 def get_queue_sizes(self, queue: str) -> Dict[str, int]:
478 """
479 Get the queue's number of tasks in each state.
480
481 Returns dict with queue size for the QUEUED, SCHEDULED, and ACTIVE
482 states. Does not include size of error queue.
483 """
484
485 states = [QUEUED, SCHEDULED, ACTIVE]
486 pipeline = self.connection.pipeline()
487 for state in states:
488 pipeline.zcard(self._key(state, queue))
489 results = pipeline.execute()
490 return dict(zip(states, results))
491
492 def get_sizes_for_queues_and_states(
493 self, queues_and_states: List[Tuple[str, str]]

Callers 2

get_total_queue_sizeMethod · 0.95
test_get_queue_sizesMethod · 0.80

Calls 2

_keyMethod · 0.95
executeMethod · 0.45

Tested by 1

test_get_queue_sizesMethod · 0.64