Base
Base classes for calculation processors that track their own performance metrics.
TrackableProcessor()
¶
Bases: EntityProcessor
Mixin for entity processors that track calculation metrics.
Provides set_metric / get_metric / get_all_metrics so
processors can record timing and other data that flows into benchmark
results and solution metadata.
Initialize the processor with metadata storage.
Source code in src/oracle_paper/data/calculator/base.py
track_metric(metric_name)
¶
Decorator to automatically track calculation time for a method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric_name
|
str
|
The name to store the metric under (e.g., "lagrange_time") |
required |
Example
@track_metric("lagrange_calculation_time") def process(self, dataset): # ... calculation code ...
The decorated method must be part of a TrackableProcessor instance. The elapsed time will be stored via set_metric(metric_name, elapsed_time).