Endpoint
Response
Response Fields
Number of currently active WebSocket connections
Number of active background processes (currently unused, always 0)
Total number of requests received since server start
Total number of errors encountered since server start
Average audio processing time in seconds, calculated from the last 100 requests
Current memory usage of the server process in megabytes (MB)
Total CPU usage as a percentage (0-100)
Array of CPU usage percentages for each individual core
Total number of CPU cores available to the server
Effective number of cores being utilized, calculated as
(cpu_total_percent / 100) * total_cpu_coresUsage Examples
cURL
JavaScript
Python
Implementation Details
Frommain.py:46-49:
ServerMetrics.get_metrics_dict() which computes metrics in real-time using:
psutil.cpu_percent()for CPU usagepsutil.Process().memory_info()for memory consumption- Rolling deque of last 100 processing times for average calculation
Monitoring and Alerts
Use this endpoint to:- Monitor server health in real-time
- Set up alerts for high error rates
- Track processing time trends
- Monitor resource utilization
- Detect connection spikes
Update Frequency
Metrics are updated in real-time:active_connections: Updated on each WebSocket connect/disconnecttotal_requests: Incremented on each new connectionerrors: Incremented on processing errorsprocessing_times: Appended after each successful audio processing- CPU/memory metrics: Computed at request time

