Adapt dashboard to show idle and used runners

This commit is contained in:
Sebastian Serth
2021-12-06 23:56:31 +01:00
parent a4003ca733
commit 563e14a44a
8 changed files with 68 additions and 27 deletions

View File

@ -15,7 +15,18 @@ module Admin
end
ExecutionEnvironment.order(:id).select(:id, :pool_size).map do |execution_environment|
execution_environment.attributes.merge(quantity: pool_size[execution_environment.id])
# Fetch the actual values (ID is stored as a symbol) or get an empty hash for merge
actual = pool_size[execution_environment.id.to_s.to_sym] || {}
template = {
id: execution_environment.id,
prewarmingPoolSize: execution_environment.pool_size,
idleRunners: 0,
usedRunners: 0,
}
# Existing values in the template get replaced with actual values
template.merge(actual)
end
end
end