File size: 2,328 Bytes
f72237c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #!/usr/bin/env python3
"""
Quick script to check video scheduler queue sizes
"""
import sys
import os
# Add the services directory to Python path
# sys.path.append(os.path.join(os.path.dirname(__file__), 'services', 'video_scheduler'))
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)
# Scheduler readiness status
ready = is_scheduler_ready(redis_conn)
status_icon = "π’" if ready else "π΄"
print(f"{status_icon} Scheduler Ready: {'YES' if ready else 'NO'}")
print()
# Synthetic queues
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()
# Source queues
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 counts
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() |