Merge pull request #143 from abf/rosa-build:142-monitoring-page
[refs #142]: Monitoring: separate "tasks in queue" into two fields
This commit is contained in:
commit
1fdf0f50d4
|
@ -1,5 +1,5 @@
|
|||
- content_for :sidebar do
|
||||
= render 'projects/build_lists/server_status', :queues => [:iso]
|
||||
= render 'server_status'
|
||||
|
||||
= form_tag product_build_lists_path, :method => :get, :html => {:class => :form} do
|
||||
.block
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
.bordered.nopadding
|
||||
%h3.medium= t('layout.build_lists.build_server_status.header')
|
||||
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.iso_workers")
|
||||
.both
|
||||
- [:workers, :tasks, :build_tasks].each do |metric|
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.#{metric}")
|
||||
.righter= @build_server_status[:iso][metric]
|
||||
.both
|
||||
%br
|
||||
|
||||
|
||||
|
|
@ -1,13 +1,32 @@
|
|||
- queues ||= [:rpm, :publish]
|
||||
.bordered.nopadding
|
||||
%h3.medium= t('layout.build_lists.build_server_status.header')
|
||||
- queues.each do |queue|
|
||||
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.#{queue}_workers")
|
||||
.lefter= t("layout.build_lists.build_server_status.rpm_workers")
|
||||
.both
|
||||
- [:count, :tasks, :build_tasks].each do |metric|
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.#{metric}")
|
||||
.righter= @build_server_status[queue][metric]
|
||||
.lefter= t("layout.build_lists.build_server_status.workers")
|
||||
.righter= @build_server_status[:rpm][:workers]
|
||||
.both
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.tasks")
|
||||
.both
|
||||
- [['user_tasks', :default_tasks], ['mass_build_tasks', :low_tasks]].each do |label, metric|
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.#{label}")
|
||||
.righter= @build_server_status[:rpm][metric]
|
||||
.both
|
||||
%br
|
||||
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.publish_workers")
|
||||
.both
|
||||
- [:workers, :tasks, :build_tasks].each do |metric|
|
||||
.table
|
||||
.lefter= t("layout.build_lists.build_server_status.#{metric}")
|
||||
.righter= @build_server_status[:publish][metric]
|
||||
.both
|
||||
%br
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -99,12 +99,14 @@ en:
|
|||
|
||||
build_server_status:
|
||||
header: Build server status
|
||||
count: '- count'
|
||||
workers: '- amount'
|
||||
tasks: '- tasks in queue'
|
||||
user_tasks: "-- user's"
|
||||
mass_build_tasks: "-- mass build's"
|
||||
build_tasks: '- tasks in execution'
|
||||
rpm_workers: Workers for building
|
||||
iso_workers: Workers for building
|
||||
publish_workers: Workers for publishing
|
||||
rpm_workers: Workers of building
|
||||
iso_workers: Workers of building
|
||||
publish_workers: Workers of publishing
|
||||
|
||||
items:
|
||||
statuses:
|
||||
|
|
|
@ -98,12 +98,14 @@ ru:
|
|||
|
||||
build_server_status:
|
||||
header: Статус сборочного сервера
|
||||
count: '- число'
|
||||
workers: '- количество'
|
||||
tasks: '- заданий в очереди'
|
||||
user_tasks: '-- пользовательских'
|
||||
mass_build_tasks: '-- массовой сборки'
|
||||
build_tasks: '- заданий выполняется'
|
||||
rpm_workers: Воркеров для сборки
|
||||
iso_workers: Воркеров для сборки
|
||||
publish_workers: Воркеров для публикации
|
||||
rpm_workers: Воркеры сборки
|
||||
iso_workers: Воркеры сборки
|
||||
publish_workers: Воркеры публикации
|
||||
|
||||
items:
|
||||
statuses:
|
||||
|
|
|
@ -28,10 +28,13 @@ module AbfWorker
|
|||
|
||||
def status_of_worker(workers, worker)
|
||||
redis, key = Resque.redis, "queue:#{worker}_worker"
|
||||
default_tasks, tasks = redis.llen("#{key}_default"), redis.llen(key)
|
||||
{
|
||||
:count => workers.count,
|
||||
:workers => workers.count,
|
||||
:build_tasks => workers.select{ |w| w.working? }.count,
|
||||
:tasks => (redis.llen("#{key}_default") + redis.llen(key))
|
||||
:default_tasks => default_tasks,
|
||||
:low_tasks => tasks,
|
||||
:tasks => (default_tasks + tasks)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue