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() - > null

Methods


utilization()

@classmethod
def utilization() - > 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