Added basic recommendation system to attach usecases and basic helpers to

This commit is contained in:
frikky
2023-06-04 17:45:54 +02:00
parent b0c82db41b
commit ea97eadfb7
5 changed files with 212 additions and 10 deletions
+3 -2
View File
@@ -398,13 +398,14 @@ func handleGetWorkflowqueue(resp http.ResponseWriter, request *http.Request) {
if !foundRecommendation {
// Add to start of org.Priorities
org.Priorities = append(org.Priorities, shuffle.Priority{
org, _ = shuffle.AddPriority(*org, shuffle.Priority{
Name: fmt.Sprintf("High CPU in environment %s", orgId),
Description: fmt.Sprintf("The environment %s has been using more than %d percent CPU. This indicates you may need to look at scaling.", orgId, percentageCheck),
Type: "scale",
Active: true,
URL: fmt.Sprintf("/admin?tab=environments"),
})
Severity: 1,
}, false)
//Make last item the first item
org.Priorities = append([]shuffle.Priority{org.Priorities[len(org.Priorities)-1]}, org.Priorities[:len(org.Priorities)-1]...)