WeaviateEx.Batch.ErrorTracking.Results (WeaviateEx v0.7.4)
View SourceAggregated results from a batch operation.
Tracks both successful and failed operations.
Memory Safety
To prevent memory exhaustion with very large batches, a maximum of
100,000 successful UUIDs are stored. When the limit is exceeded,
oldest entries (lowest indices) are evicted using a rolling window
strategy. Use max_stored_results/0 to get the current limit.
Summary
Functions
Add an error (object or reference) to the results.
Record a successful object insertion with its index and UUID.
Get errors list.
Check if any errors occurred during the batch operation.
Get the maximum number of stored results.
Create a new empty results struct.
Get the total number of errors (objects + references).
Check if results are within the maximum stored limit.
Set the elapsed time for the batch operation.
Get statistics summary for the results.
Types
@type t() :: %WeaviateEx.Batch.ErrorTracking.Results{ elapsed_seconds: float(), failed_objects: [WeaviateEx.Batch.ErrorTracking.ErrorObject.t()], failed_references: [WeaviateEx.Batch.ErrorTracking.ErrorReference.t()], successful_uuids: %{required(non_neg_integer()) => String.t()} }
Functions
@spec add_error( t(), WeaviateEx.Batch.ErrorTracking.ErrorObject.t() | WeaviateEx.Batch.ErrorTracking.ErrorReference.t() ) :: t()
Add an error (object or reference) to the results.
@spec add_success(t(), non_neg_integer(), String.t()) :: t()
Record a successful object insertion with its index and UUID.
When the number of stored results exceeds the maximum (100,000), oldest entries (lowest indices) are evicted to prevent memory exhaustion.
@spec errors(t()) :: [ WeaviateEx.Batch.ErrorTracking.ErrorObject.t() | WeaviateEx.Batch.ErrorTracking.ErrorReference.t() ]
Get errors list.
Check if any errors occurred during the batch operation.
@spec max_stored_results() :: pos_integer()
Get the maximum number of stored results.
Results beyond this limit will have oldest entries evicted.
@spec new() :: t()
Create a new empty results struct.
@spec number_errors(t()) :: non_neg_integer()
Get the total number of errors (objects + references).
Check if results are within the maximum stored limit.
Set the elapsed time for the batch operation.
@spec statistics(t()) :: %{ processed: non_neg_integer(), successful: non_neg_integer(), failed: non_neg_integer() }
Get statistics summary for the results.
Returns a map with processed, successful, and failed counts.