Performance Monitoring Plugin¶
Automatic execution time tracking for inference workflows.
Overview¶
Enabled by Default: Tracks execution time for all inference workflows with zero configuration. Provides timing information in logs and saves detailed metrics to the result pickle file.
How It Works¶
The plugin registers hooks at workflow start and completion:
INFERENCE_START_HOOK # Records start timestamp
INFERENCE_COMPLETE_HOOK # Calculates and stores execution time
Process:
Records timestamp when inference begins
Calculates total execution time at completion
Stores timing data in
DataCollector.batch_metadata['performance']Logs human-readable timing information
Usage¶
Automatic Logging¶
Performance metrics are automatically logged for every inference:
vipr --config config.yaml inference run
Console Output:
[INFO] Inference workflow started at: 2025-11-21 15:30:45.123456
[INFO] Inference execution time: 2.34 seconds
Accessing Timing Data¶
Performance data is saved to the pickle file in batch_metadata:
import pickle
with open('storage/results/<result_id>/result.pkl', 'rb') as f:
result_data = pickle.load(f)
performance = result_data['batch_metadata']['performance']
print(f"Execution time: {performance['execution_time_formatted']}")
print(f"Started: {performance['start_datetime']}")
Available Fields¶
The batch_metadata['performance'] dictionary contains:
Field |
Type |
Description |
Example |
|---|---|---|---|
|
|
Total time in seconds |
|
|
|
Human-readable time |
|
|
|
Unix timestamp (start) |
|
|
|
Unix timestamp (end) |
|
|
|
ISO format start |
|
|
|
ISO format end |
|
Measurement Scope¶
Includes all 6 inference steps (Load Data → Load Model → Normalize → Preprocess → Predict → Postprocess)
Includes hook/filter execution time
Uses Python’s
time.time()with ~1 microsecond precision
Configuration¶
The plugin is enabled by default. To disable it, create a plugin configuration file:
Default location (automatically loaded):
# vipr-plugins.yaml (in your working directory)
plugin.performance:
enabled: false
Custom location (via environment variable):
export VIPR_PLUGIN_CONFIG=/path/to/my-custom-plugins.yaml
This configuration overrides the default settings from vipr-core/vipr/config/plugins.yaml.
See Also¶
Inference Plugin - 6-step inference workflow
API Plugin - REST API integration
vipr-core/vipr/plugins/performance/performance.py- Source code