diff options
author | Pascal Betz <pascal.betz@gmail.com> | 2016-09-06 21:40:49 +0200 |
---|---|---|
committer | Pascal Betz <pascal.betz@gmail.com> | 2016-09-07 12:16:05 +0200 |
commit | 1112b5a28323bdcee5b7e910575097d1ccb6256c (patch) | |
tree | acd6378f677a3ee7e63ce58662cbfbbebc68e0c0 /app/helpers/sidekiq_helper.rb | |
parent | 80e575af523f49d314dc83e02989115193b9ab64 (diff) | |
download | gitlab-ce-1112b5a28323bdcee5b7e910575097d1ccb6256c.tar.gz |
Move parsing of sidekiq ps into helper
Diffstat (limited to 'app/helpers/sidekiq_helper.rb')
-rw-r--r-- | app/helpers/sidekiq_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/sidekiq_helper.rb b/app/helpers/sidekiq_helper.rb new file mode 100644 index 00000000000..3644039d38e --- /dev/null +++ b/app/helpers/sidekiq_helper.rb @@ -0,0 +1,12 @@ +module SidekiqHelper + SIDEKIQ_PS_REGEXP = /\A([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+(.+)\s+(sidekiq.*\])\s+\z/ + + def parse_sidekiq_ps(line) + match = line.match(SIDEKIQ_PS_REGEXP) + if match + match[1..6] + else + %w{? ? ? ? ? ?} + end + end +end |