Add aws environments to the statistics
but only with the field usedRunners.
This commit is contained in:
@ -59,5 +59,13 @@ func (n *AbstractManager) Delete(id dto.EnvironmentID) (bool, error) {
|
||||
}
|
||||
|
||||
func (n *AbstractManager) Statistics() map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData {
|
||||
return map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData{}
|
||||
if n.runnerManager == nil {
|
||||
return map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData{}
|
||||
}
|
||||
|
||||
statistics := n.NextHandler().Statistics()
|
||||
for k, v := range n.runnerManager.EnvironmentStatistics() {
|
||||
statistics[k] = v
|
||||
}
|
||||
return statistics
|
||||
}
|
||||
|
@ -59,6 +59,11 @@ func (a *AWSEnvironment) Sample() (r runner.Runner, ok bool) {
|
||||
|
||||
// The following methods are not supported at this moment.
|
||||
|
||||
// IdleRunnerCount is not supported as we have no information about the AWS managed prewarming pool.
|
||||
func (a *AWSEnvironment) IdleRunnerCount() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
// PrewarmingPoolSize is neither supported nor required. It is handled transparently by AWS.
|
||||
func (a *AWSEnvironment) PrewarmingPoolSize() uint {
|
||||
return 0
|
||||
@ -111,7 +116,3 @@ func (a *AWSEnvironment) AddRunner(_ runner.Runner) {
|
||||
func (a *AWSEnvironment) DeleteRunner(_ string) {
|
||||
panic("not supported")
|
||||
}
|
||||
|
||||
func (a *AWSEnvironment) IdleRunnerCount() int {
|
||||
panic("not supported")
|
||||
}
|
||||
|
@ -67,7 +67,3 @@ func isAWSEnvironment(request dto.ExecutionEnvironmentRequest) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *AWSEnvironmentManager) Statistics() map[dto.EnvironmentID]*dto.StatisticalExecutionEnvironmentData {
|
||||
return a.NextHandler().Statistics()
|
||||
}
|
||||
|
@ -120,10 +120,6 @@ func (m *NomadEnvironmentManager) CreateOrUpdate(id dto.EnvironmentID, request d
|
||||
return !isExistingEnvironment, 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