# frozen_string_literal: true module SidekiqHelper SIDEKIQ_PS_REGEXP = %r{\A (?\d+)\s+ (?[\d\.,]+)\s+ (?[\d\.,]+)\s+ (?[DIEKNRSTVWXZLpsl\+<>/\d]+)\s+ (?.+?)\s+ (?(?:ruby\d+:\s+)?sidekiq.*\].*) \z}x.freeze def parse_sidekiq_ps(line) match = line.strip.match(SIDEKIQ_PS_REGEXP) match ? match[1..6] : Array.new(6, '?') end end