BatchStats
Monitoring statistics exposed by DynamicBatcher.stats.
Attributes
| Attribute | Type | Description |
|---|---|---|
| total_submitted | int = 0 | Total records submitted via submit. |
| total_completed | int = 0 | Total records whose futures have been resolved. |
| total_batches | int = 0 | Number of batches dispatched. |
| total_batch_cost | int = 0 | Sum of estimated cost across all batches. |
| avg_batch_size | float = 0.0 | Running average records per batch. |
| avg_batch_cost | float = 0.0 | Running average cost per batch. |
| busy_time_s | float = 0.0 | Cumulative seconds spent inside process_fn. |
| idle_time_s | float = 0.0 | Cumulative seconds the processing loop waited for a batch to be assembled. |
Constructor
Signature
def BatchStats() - > null
Methods
utilization()
@classmethod
def utilization() - > float
Fraction of wall-clock time spent processing (0.0-1.0).
Returns
| Type | Description |
|---|---|
float | The ratio of busy time to total time, representing the efficiency of the batcher's processing loop |