Skip to main content

Monitoring & Metrics

The Transfer Learning Video Processing Pipeline includes comprehensive monitoring and metrics tracking capabilities to help you understand performance, resource usage, and processing status.

Real-time Dashboard

The pipeline provides a beautiful real-time dashboard powered by Rich, accessible through the CLI:

Dashboard Options

string
Filter metrics for a specific video ID
number
default:"2.0"
Dashboard refresh rate in seconds
boolean
default:"false"
Show historical metrics instead of real-time data

Dashboard Sections

The dashboard is divided into several panels:
  1. Header Panel
    • Current video being processed
    • Processing duration
    • Frame progress
  2. Performance Metrics
    • Mean and P95 latency
    • Throughput statistics
    • Total processing time
  3. System Resources
    • CPU usage (color-coded)
    • Memory usage (color-coded)
    • Disk usage
    • Network I/O
    • GPU metrics (if available)
  4. API Statistics
    • API call counts
    • Mean latency per API
    • Success/failure rates
  5. Custom Metrics
    • User-defined metrics
    • Application-specific KPIs

Metrics Collection

System Metrics

The pipeline automatically tracks system resource usage:

Performance Metrics

Track performance-related metrics:

Custom Metrics

Add your own custom metrics:

Using the Timer

The pipeline provides a convenient Timer context manager for timing operations:

Metrics Storage

Metrics are automatically saved to JSON files in dated directories:

Metrics File Format

Historical Analysis

View historical metrics for a specific video:
This will load and display the most recent metrics file for the specified video ID.

Best Practices

  1. Start/End Tracking
  2. Use Timers for Operations
  3. Add Custom Metrics
  4. Monitor Resource Usage
    • Keep an eye on system resource usage
    • Set up alerts for high resource utilization
    • Use color-coded indicators in the dashboard
  5. Regular Cleanup

Configuration

Configure monitoring settings in your .env file:
Or use the config command:

Troubleshooting

Common Issues

  1. High Resource Usage
    • Check system metrics panel for bottlenecks
    • Adjust batch sizes and concurrent processing
    • Consider GPU offloading if available
  2. Slow Processing
    • Monitor API latencies in the dashboard
    • Check network I/O metrics
    • Optimize batch sizes and caching
  3. Missing Metrics
    • Ensure metrics tracking is enabled
    • Check file permissions in metrics directory
    • Verify proper start/end processing calls

Debug Mode

Enable debug logging for more detailed information:

API Reference

MetricsTracker

method
Start tracking metrics for a video processing run
method
End tracking metrics and save results
method
Record an API call with its latency
method
Add a custom metric

Timer

constructor
Initialize a timer for operation tracking