Get System Analytics
GET /api/agents/swarm/system/analytics
Get system-wide analytics and trends
Retrieves comprehensive analytics including swarm performance trends over time, resource usage patterns, efficiency metrics historical data, and predictive insights. Analyzes past swarm executions to identify trends, bottlenecks, and optimization opportunities.
@param management_interface: Injected swarm management interface @returns SystemAnalyticsResponse with analytics, trends, and performance insights @raises HTTPException: If analytics retrieval fails (500)
Analytics Include:
- Performance trends over time (hourly, daily, weekly)
- Resource usage patterns and predictions
- Swarm type efficiency comparisons
- Success/failure rate trends
- Agent utilization statistics
- Bottleneck identification and recommendations
Responses
Section titled “ Responses ”Successful Response
Response model for swarm system analytics.
Provides comprehensive analytics including swarm performance trends over time, resource usage patterns, efficiency metrics historical data, and predictive insights for optimization and capacity planning.
Fields:
performance_trends: Dictionary containing performance trends over time (hourly, daily, weekly)resource_patterns: Dictionary containing resource usage patterns and predictionsefficiency_history: List of efficiency metrics over timepredictions: Dictionary containing predictive insights and recommendationsswarm_type_efficiency: Dictionary comparing efficiency across different swarm typessuccess_rate_trends: Dictionary containing success/failure rate trends over timeagent_utilization: Dictionary containing agent utilization statisticsbottleneck_identification: Dictionary containing identified bottlenecks and recommendations
Usage: GET /api/swarm/system/analytics returns this response model with comprehensive analytics, trends, and performance insights.
JSON Example:
{
"performance_trends": {
"hourly": [0.85, 0.87, 0.86, 0.88],
"daily": [0.84, 0.86, 0.85, 0.87],
"weekly": [0.83, 0.85, 0.86, 0.87]
},
"resource_patterns": {
"peak_hours": [10, 11, 14, 15],
"average_cpu": 45.2,
"average_memory": 1024
},
"efficiency_history": [
{"timestamp": "2025-01-31T10:00:00Z", "efficiency": 0.85},
{"timestamp": "2025-01-31T11:00:00Z", "efficiency": 0.87}
],
"predictions": {
"next_hour_efficiency": 0.88,
"resource_forecast": {"cpu": 50, "memory": 1200}
},
"swarm_type_efficiency": {
"code_analysis": 0.90,
"testing": 0.85,
"performance": 0.88
},
"success_rate_trends": {
"last_24h": 0.95,
"last_7d": 0.94,
"last_30d": 0.93
},
"agent_utilization": {
"average": 0.75,
"peak": 0.95
},
"bottleneck_identification": {
"bottlenecks": ["memory_allocation", "agent_coordination"],
"recommendations": ["Increase memory pool", "Optimize agent communication"]
}
}object
Performance trends over time
object
Resource usage patterns and predictions
object
Efficiency metrics over time
Arbitrary JSON-shaped data. Flattened from a recursive type alias for wiki rendering — the live API accepts any JSON-compatible value (string, number, bool, null, array, or nested object).
object
Predictive insights and recommendations
object
Efficiency comparison across swarm types
object
Success/failure rate trends over time
object
Agent utilization statistics
object
Identified bottlenecks and recommendations