def statistics(self):
"""Returns an object containing debugging information.
Currently the following fields are defined:
* ``qsize``: The number of items currently in the queue.
* ``capacity``: The maximum number of items the queue can hold.
* ``tasks_waiting_put``: The number of tasks blocked on this queue's
:meth:`put` method.
* ``tasks_waiting_get``: The number of tasks blocked on this queue's
:meth:`get` method.
"""
return _QueueStats(
qsize=len(self._data),
capacity=self.capacity,
tasks_waiting_put=self._put_semaphore.statistics().tasks_waiting,
tasks_waiting_get=self._get_semaphore.statistics().tasks_waiting,
tasks_waiting_join=self._join_lot.statistics().tasks_waiting
)
评论列表
文章目录