Spaces:
Running
Running
Download backend/scripts/verify_scaling.py from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/scripts/verify_scaling.py
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/backend/scripts/verify_scaling.py
-
curl -L -o verify_scaling.py https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/scripts/verify_scaling.py
1.24 kB
| import asyncio | |
| import sys | |
| import os | |
| # Add project root to sys.path | |
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) | |
| # Mock settings before importing app | |
| os.environ["DATABASE_URL"] = "postgresql://user:pass@localhost/db" | |
| os.environ["SUPABASE_URL"] = "https://test.supabase.co" | |
| os.environ["SUPABASE_KEY"] = "test" | |
| os.environ["SECRET_KEY"] = "test_secret_key_long_enough_32_chars_" | |
| os.environ["GROQ_API_KEY"] = "test" * 20 | |
| from app.services.ai_queue import get_ai_queue | |
| from app.services.voice_service import voice_service | |
| async def test_limits(): | |
| print("--- SCALING CONFIGURATION VERIFICATION ---") | |
| # 1. Check AI Queue | |
| queue = get_ai_queue() | |
| print(f"AI Queue Max RPM: {queue.max_rpm}") | |
| print(f"AI Queue Max Concurrent: {queue.max_concurrent}") | |
| # 2. Check Voice Semaphore | |
| print(f"Voice Semaphore Limit: {voice_service.semaphore._value}") | |
| # 3. Check DB config from database.py manually since we can't easily check pool size without engine | |
| from app.core.database import async_engine | |
| print(f"DB Pool Size Config: {async_engine.pool.size()}") | |
| print("\n✅ Scaling configurations verified.") | |
| if __name__ == "__main__": | |
| asyncio.run(test_limits()) | |