spdl.pipeline.QueuePerfStats

class QueuePerfStats(elapsed: float, num_items: int, ave_put_time: float, ave_get_time: float, occupancy_rate: float)[source]

Performance statistics collected by StatsQueue.

See also

Attributes

qps

Query per second.

elapsed

The duration of measurement in second.

num_items

The number of items went through the queue.

ave_put_time

The average time (in second) put operation was blocked.

ave_get_time

The average time (in second) get operation was blocked.

occupancy_rate

The relative time where the queue was not empty.

ave_get_time: float

The average time (in second) get operation was blocked.

It is the average time that the downstream task had to wait before the queue has the next item to fetch.

Note that when there are multiple tasks attempting to get the next item (i.e. the downstream task has concurrency larger than 1), then the average time becomes longer.

ave_put_time: float

The average time (in second) put operation was blocked.

It is the average time that the upstream task had to wait before the queue has a space to put the result.

Note that when there are multiple tasks attempting to put a result (i.e. the upstream task has concurrency larger than 1), then the average time becomes longer.

elapsed: float

The duration of measurement in second.

num_items: int

The number of items went through the queue.

occupancy_rate: float

The relative time where the queue was not empty.

The value close to 1 means that the queue has always the next data available. The upstream stage is producing data faster than the speed of the downstream stage consuming them.

The value close to 0 means that the queue is always empty. The downstream stage is waiting for the next data and fetches one as soon as the upstream stage puts it. This suggests that the pipeline is suffering from data starvation.

property qps: float

Query per second. i.e. num_items / elapsed.