google.appengine.api.taskqueue.QueueStatistics

Represents the current state of a queue.

Inherits From: expected_type

queue The queue instance for which you intend to use QueueStatistics.
tasks The number of tasks remaining in the queue.

oldest_eta_usec The eta of the oldest non-completed task for the queue; None if unknown or no incomplete tasks remain in the queue. The value None indicates that the queue has no backlog; the queue is empty or only contains tasks with an eta in the future. The eta represents the time at which a push queue task is eligible to run or a pull queue task can be leased. The value is expressed as microseconds since January 1, 1970. App Engine will not run a task before its eta time.
executed_last_minute The number of tasks ran or leased in the last minute.
in_flight For push queues, the number of tasks that are currently running. This value is not relevant for pull queues.
enforced_rate For push queues, the current enforced rate in tasks per second. This value is not relevant for pull queues. The enforced rate is the actual rate at which tasks are being processed after any throttling done by App Engine to prevent the queue from overwhelming your application. The enforced rate can be smaller than the rate you specify in the queue configuration. If the enforced rate is too small, you can change performance settings for your application.

Methods

fetch

View source

Get the queue details for multiple queues.

Use QueueStatistics.fetch() to get QueueStatistics objects for the queues you are interested in. You can specify one or more queues.

Example::

statsList = taskqueue.QueueStatistics.fetch([taskqueue.Queue("foo"),
                                             taskqueue.Queue("bar")])

Args
queue_or_queues The queue or list of queues for which you are obtaining statistics. If you are retrieving statistics for a single queue, you can supply either a queue instance or the name of the queue. If you are retrieving statistics for a list of queues, you can supply an iterable list of queue instances or an iterable list of queue names.
deadline The maximum number of seconds to wait before aborting the method call.

Returns
If an iterable (other than string) is provided as input, a list of of QueueStatistics objects will be returned, one for each queue in the order requested.

Otherwise, if a single item was provided as input, then a single QueueStatistics object will be returned.

Raises
TypeError If queue_or_queues is not a queue instance, string, an iterable containing only queue instances, or an iterable containing only strings. Error-subclass on application errors.

fetch_async

View source

Asynchronously get the queue details for multiple queues.

Example::

rpc = taskqueue.create_rpc(deadline=1.0)
taskqueue.QueueStatistics.fetch_async([taskqueue.Queue("foo"),
                                        taskqueue.Queue("bar")], rpc)
statsList = rpc.get_result()

Args
queue_or_queues The queue or list of queues for which you are obtaining statistics. If you are retrieving statistics for a single queue, you can supply either a queue instance or the name of the queue. If you are retrieving a list of queues, you can supply an iterable list of queue instances or an iterable list of queue names.
rpc An optional UserRPC object.

Returns
A UserRPC object. Call get_result() to complete the RPC and obtain the result.

If an iterable (other than string) is provided as input, the result will be a list of of QueueStatistics objects, one for each queue in the order requested.

Otherwise, if a single item was provided as input, then the result will be a single QueueStatistics object.

Raises
TypeError If queue_or_queues is not a queue instance, string, an iterable containing only queue instances, or an iterable containing only strings.

__eq__

View source

Return self==value.

__ne__

View source

Return self!=value.