Skip to main content

BatchStats

Monitoring statistics exposed by DynamicBatcher.stats.

Attributes​

AttributeTypeDescription
total_submittedint = 0Total records submitted via submit.
total_completedint = 0Total records whose futures have been resolved.
total_batchesint = 0Number of batches dispatched.
total_batch_costint = 0Sum of estimated cost across all batches.
avg_batch_sizefloat = 0.0Running average records per batch.
avg_batch_costfloat = 0.0Running average cost per batch.
busy_time_sfloat = 0.0Cumulative seconds spent inside process_fn.
idle_time_sfloat = 0.0Cumulative seconds the processing loop waited for a batch to be assembled.

Constructor​

Signature​

def BatchStats(
total_submitted: int = 0,
total_completed: int = 0,
total_batches: int = 0,
total_batch_cost: int = 0,
avg_batch_size: float = 0.0,
avg_batch_cost: float = 0.0,
busy_time_s: float = 0.0,
idle_time_s: float = 0.0
) -> null

Parameters​

NameTypeDescription
total_submittedint = 0Total records submitted via submit.
total_completedint = 0Total records whose futures have been resolved.
total_batchesint = 0Number of batches dispatched.
total_batch_costint = 0Sum of estimated cost across all batches.
avg_batch_sizefloat = 0.0Running average records per batch.
avg_batch_costfloat = 0.0Running average cost per batch.
busy_time_sfloat = 0.0Cumulative seconds spent inside process_fn.
idle_time_sfloat = 0.0Cumulative seconds the processing loop waited for a batch to be assembled.

Methods​


utilization()​

@property
def utilization(self) -> float: ...

Fraction of wall-clock time spent processing (0.0-1.0).

Returns​

TypeDescription
floatThe ratio of busy time to total time, representing the efficiency of the batcher's processing loop.