From 4886d8fd03087ceb07c96c3067120b0c1815354d Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 15 Oct 2013 13:24:17 +0200 Subject: [PATCH] Show sidekiq running processes in the background_jobs page. --- .../admin/background_jobs/show.html.haml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/views/admin/background_jobs/show.html.haml b/app/views/admin/background_jobs/show.html.haml index 2d4ffc10d5f..dcc8681cbb5 100644 --- a/app/views/admin/background_jobs/show.html.haml +++ b/app/views/admin/background_jobs/show.html.haml @@ -2,3 +2,32 @@ %br .ui-box %iframe{src: sidekiq_path, width: '100%', height: 900, style: "border: none"} +%h4 Sidekiq running processes +- sidekiq_processes = `ps -eo euser,pid,pcpu,pmem,stat,start,command | grep sidekiq | grep -v grep` +- if sidekiq_processes.empty? + %b There is no running sidekiq process +- else + .ui-box + %table.zebra-striped + %thead + %th USER + %th + %th PID + %th + %th CPU + %th + %th MEM + %th + %th STATE + %th + %th START + %th + %th COMMAND + %th + - sidekiq_processes.split("\n").each do |process| + - data = process.gsub!(/\s+/m, '|').strip.split('|') + %tr + - 6.times do + %td= data.shift + %td + %td= data.join(" ")