runservice executor: report ActiveTasksLimit

Add a config option to set the active tasks limit and report it.
This commit is contained in:
Simone Gotti 2019-04-17 15:51:20 +02:00
parent 455623e58a
commit 4dd89646af
3 changed files with 9 additions and 5 deletions

View File

@ -82,6 +82,8 @@ type RunServiceExecutor struct {
Web Web `yaml:"web"` Web Web `yaml:"web"`
Labels map[string]string `yaml:"labels"` Labels map[string]string `yaml:"labels"`
// ActiveTasksLimit is the max number of concurrent active tasks
ActiveTasksLimit int `yaml:"active_tasks_limit"`
} }
type ConfigStore struct { type ConfigStore struct {

View File

@ -666,6 +666,7 @@ func (e *Executor) sendExecutorStatus(ctx context.Context) error {
ID: e.id, ID: e.id,
ListenURL: e.listenURL, ListenURL: e.listenURL,
Labels: labels, Labels: labels,
ActiveTasksLimit: e.c.ActiveTasksLimit,
ActiveTasks: activeTasks, ActiveTasks: activeTasks,
} }

View File

@ -658,6 +658,7 @@ type Executor struct {
Labels map[string]string `json:"labels,omitempty"` Labels map[string]string `json:"labels,omitempty"`
ActiveTasksLimit int `json:"active_tasks_limit,omitempty"`
ActiveTasks int `json:"active_tasks,omitempty"` ActiveTasks int `json:"active_tasks,omitempty"`
// internal values not saved // internal values not saved