Add statistics route for execution environments
* Add statistics route for execution environments * Add maximum to port api definition Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,9 @@ type Manager interface {
|
||||
// Delete removes the specified execution environment.
|
||||
// Iff the specified environment could not be found Delete returns false.
|
||||
Delete(id dto.EnvironmentID) (bool, error)
|
||||
|
||||
// Statistics returns statistical data for each execution environment.
|
||||
Statistics() map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData
|
||||
}
|
||||
|
||||
type NomadEnvironmentManager struct {
|
||||
@@ -156,6 +159,10 @@ func (m *NomadEnvironmentManager) Delete(id dto.EnvironmentID) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (m *NomadEnvironmentManager) Statistics() map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData {
|
||||
return m.runnerManager.EnvironmentStatistics()
|
||||
}
|
||||
|
||||
func (m *NomadEnvironmentManager) Load() error {
|
||||
templateJobs, err := m.api.LoadEnvironmentJobs()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user