diff --git a/app/views/platforms/product_build_lists/_filter.html.haml b/app/views/platforms/product_build_lists/_filter.html.haml index fa2824e48..3b785eb86 100644 --- a/app/views/platforms/product_build_lists/_filter.html.haml +++ b/app/views/platforms/product_build_lists/_filter.html.haml @@ -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 diff --git a/app/views/platforms/product_build_lists/_server_status.html.haml b/app/views/platforms/product_build_lists/_server_status.html.haml new file mode 100644 index 000000000..c476c0f32 --- /dev/null +++ b/app/views/platforms/product_build_lists/_server_status.html.haml @@ -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 + + + diff --git a/app/views/projects/build_lists/_server_status.html.haml b/app/views/projects/build_lists/_server_status.html.haml index 8a86a33e6..72d2acf47 100644 --- a/app/views/projects/build_lists/_server_status.html.haml +++ b/app/views/projects/build_lists/_server_status.html.haml @@ -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.rpm_workers") + .both + .table + .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.#{queue}_workers") + .lefter= t("layout.build_lists.build_server_status.#{label}") + .righter= @build_server_status[:rpm][metric] .both - - [:count, :tasks, :build_tasks].each do |metric| - .table - .lefter= t("layout.build_lists.build_server_status.#{metric}") - .righter= @build_server_status[queue][metric] - .both - %br + %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 + + + diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 02bed316b..21d0f6fe5 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -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: diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index c3c93fbed..ef86d4f57 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -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: diff --git a/lib/abf_worker/status_inspector.rb b/lib/abf_worker/status_inspector.rb index 6aa722c01..ccdd8376d 100644 --- a/lib/abf_worker/status_inspector.rb +++ b/lib/abf_worker/status_inspector.rb @@ -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, - :build_tasks => workers.select{ |w| w.working? }.count, - :tasks => (redis.llen("#{key}_default") + redis.llen(key)) + :workers => workers.count, + :build_tasks => workers.select{ |w| w.working? }.count, + :default_tasks => default_tasks, + :low_tasks => tasks, + :tasks => (default_tasks + tasks) } end