diff --git a/decisionmaker/domain/pod.go b/decisionmaker/domain/pod.go index 859f8ef..4b62e72 100644 --- a/decisionmaker/domain/pod.go +++ b/decisionmaker/domain/pod.go @@ -28,7 +28,7 @@ type Intent struct { } type SchedulingIntents struct { - Priority bool `json:"priority"` // If true, set vtime to minimum vtime + Priority int `json:"priority"` // Priority value; higher value means higher priority ExecutionTime uint64 `json:"execution_time"` // Time slice for this process in nanoseconds PID int `json:"pid,omitempty"` // Process ID to apply this strategy to Selectors []LabelSelector `json:"selectors,omitempty"` // Label selectors to match pods diff --git a/decisionmaker/rest/intent_handler.go b/decisionmaker/rest/intent_handler.go index d4438e9..f513810 100644 --- a/decisionmaker/rest/intent_handler.go +++ b/decisionmaker/rest/intent_handler.go @@ -54,7 +54,7 @@ func (h *Handler) HandleIntents(w http.ResponseWriter, r *http.Request) { // SchedulingStrategy represents a strategy for process scheduling type SchedulingIntents struct { - Priority bool `json:"priority"` // If true, set vtime to minimum vtime + Priority int `json:"priority"` // Priority value; higher value means higher priority ExecutionTime uint64 `json:"execution_time"` // Time slice for this process in nanoseconds PID int `json:"pid,omitempty"` // Process ID to apply this strategy to Selectors []LabelSelector `json:"selectors,omitempty"` // Label selectors to match pods diff --git a/decisionmaker/service/service.go b/decisionmaker/service/service.go index 5aa3b95..0daa5a2 100644 --- a/decisionmaker/service/service.go +++ b/decisionmaker/service/service.go @@ -113,7 +113,7 @@ func (svc *Service) ProcessIntents(ctx context.Context, intents []*domain.Intent continue } schedulingIntent := &domain.SchedulingIntents{ - Priority: intent.Priority > 0, + Priority: intent.Priority, ExecutionTime: uint64(intent.ExecutionTime), PID: process.PID, CommandRegex: intent.CommandRegex,