Fix: pass time_range parameter to generate_recommendations for proper 7-day data

This commit is contained in:
2025-10-03 09:41:02 -03:00
parent eb2c0c23b5
commit 6c2821609c
2 changed files with 4 additions and 4 deletions

View File

@@ -1435,12 +1435,12 @@ class HistoricalAnalysisService:
"error": str(e)
}
async def generate_recommendations(self, namespace: str, workload: str) -> List[Dict[str, Any]]:
async def generate_recommendations(self, namespace: str, workload: str, time_range: str = "24h") -> List[Dict[str, Any]]:
"""Generate recommendations based on historical data"""
try:
# Get current usage data
cpu_data = await self.get_cpu_usage_history(namespace, workload, "24h")
memory_data = await self.get_memory_usage_history(namespace, workload, "24h")
cpu_data = await self.get_cpu_usage_history(namespace, workload, time_range)
memory_data = await self.get_memory_usage_history(namespace, workload, time_range)
recommendations = []