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
Collecting Runtime Statistics : How to export the runtime performance statistics.
Analyzing the Performance : How to use the exported stats.
Attributes
Query per second.
The duration of measurement in second.
The number of items went through the queue.
The average time (in second)
put
operation was blocked.The average time (in second)
get
operation was blocked.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.
- 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.