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 18ca54d2d..72d2acf47 100644 --- a/app/views/projects/build_lists/_server_status.html.haml +++ b/app/views/projects/build_lists/_server_status.html.haml @@ -1,42 +1,32 @@ -- queues ||= [:rpm, :publish] .bordered.nopadding %h3.medium= t('layout.build_lists.build_server_status.header') - - if queues.include? :rpm + .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.rpm_workers") + .lefter= t("layout.build_lists.build_server_status.#{label}") + .righter= @build_server_status[:rpm][metric] .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 - .table - .lefter= t("layout.build_lists.build_server_status.user_tasks") - .righter= @build_server_status[:rpm][:default_tasks] - .both - .table - .lefter= t("layout.build_lists.build_server_status.mass_build_tasks") - .righter= @build_server_status[:rpm][:low_tasks] - .both - %br + %br - - (queues - [:rpm]).each do |queue| + .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.#{queue}_workers") + .lefter= t("layout.build_lists.build_server_status.#{metric}") + .righter= @build_server_status[:publish][metric] .both - - [:workers, :tasks, :build_tasks].each do |metric| - .table - .lefter= t("layout.build_lists.build_server_status.#{metric}") - - if metric == :tasks - - count = @build_server_status[queue][:default_tasks] + @build_server_status[queue][:low_tasks] - - else - - count = @build_server_status[queue][metric] - .righter= count - .both - %br + %br diff --git a/lib/abf_worker/status_inspector.rb b/lib/abf_worker/status_inspector.rb index 8693954c3..ccdd8376d 100644 --- a/lib/abf_worker/status_inspector.rb +++ b/lib/abf_worker/status_inspector.rb @@ -32,8 +32,9 @@ module AbfWorker { :workers => workers.count, :build_tasks => workers.select{ |w| w.working? }.count, - :default_tasks => redis.llen("#{key}_default"), - :low_tasks => redis.llen(key) + :default_tasks => default_tasks, + :low_tasks => tasks, + :tasks => (default_tasks + tasks) } end