File: sidekiq_jobs.rb

package info (click to toggle)
ruby-test-prof 0.12.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 508 kB
  • sloc: ruby: 4,075; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

TestProf::EventProf::CustomEvents.register("sidekiq.jobs") do
  if TestProf.require(
    "sidekiq/testing",
    <<~MSG
      Failed to load Sidekiq.

      Make sure that "sidekiq" gem is in your Gemfile.
    MSG
  )
    TestProf::EventProf.monitor(
      Sidekiq::Client,
      "sidekiq.jobs",
      :raw_push,
      guard: ->(*) { Sidekiq::Testing.inline? }
    )
    TestProf::EventProf.configure do |config|
      config.rank_by = :count
    end
  end
end