| |
| """ |
| Quick script to check video scheduler queue sizes |
| """ |
|
|
| import sys |
| import os |
|
|
| |
| |
|
|
| from services.video_scheduler.redis_utils import ( |
| get_redis_connection, |
| get_5s_queue_size, |
| get_10s_queue_size, |
| get_organic_upscaling_queue_size, |
| get_organic_compression_queue_size, |
| get_pexels_queue_size, |
| get_youtube_queue_size, |
| is_scheduler_ready |
| ) |
|
|
| def main(): |
| """Check and display all queue sizes""" |
| try: |
| redis_conn = get_redis_connection() |
| |
| print("=" * 50) |
| print("π VIDEO SCHEDULER QUEUE STATUS") |
| print("=" * 50) |
| |
| |
| ready = is_scheduler_ready(redis_conn) |
| status_icon = "π’" if ready else "π΄" |
| print(f"{status_icon} Scheduler Ready: {'YES' if ready else 'NO'}") |
| print() |
| |
| |
| print("π¬ SYNTHETIC QUEUES:") |
| print(f" 5s chunks: {get_5s_queue_size(redis_conn):>4}") |
| print(f" 10s chunks: {get_10s_queue_size(redis_conn):>4}") |
| print(f" Compressed chunks: {get_organic_compression_queue_size(redis_conn):>4}") |
| print(f" Upscaling chunks: {get_organic_upscaling_queue_size(redis_conn):>4}") |
| print() |
| |
| |
| print("π₯ SOURCE QUEUES:") |
| print(f" Pexels IDs: {get_pexels_queue_size(redis_conn):>4}") |
| print(f" YouTube IDs: {get_youtube_queue_size(redis_conn):>4}") |
| print() |
| |
| |
| |
| total_synthetic = get_5s_queue_size(redis_conn) + get_10s_queue_size(redis_conn) + get_organic_compression_queue_size(redis_conn) + get_organic_upscaling_queue_size(redis_conn) |
| total_source = get_pexels_queue_size(redis_conn) + get_youtube_queue_size(redis_conn) |
| |
| print("π TOTALS:") |
| print(f" Total Synthetic: {total_synthetic:>4}") |
| print(f" Total Source: {total_source:>4}") |
| print("=" * 50) |
| |
| except Exception as e: |
| print(f"β Error checking queues: {str(e)}") |
| print("π‘ Make sure Redis is running and accessible") |
| sys.exit(1) |
|
|
| if __name__ == "__main__": |
| main() |