Sha256: a0f97c955e04326dc6d5247b0baf925fd01484743202b6f341afa28fae30d566

Contents?: true

Size: 597 Bytes

Versions: 6

Compression:

Stored size: 597 Bytes

Contents

require 'tracebin/patches'
require 'tracebin/system_health_sample'
require 'concurrent'

require 'sidekiq/launcher'

::Sidekiq::Launcher.class_eval do
  alias_method :run_without_tracebin, :run
  alias_method :stop_without_tracebin, :stop

  def run
    @tracebin_task = Concurrent::TimerTask.new(execution_interval: 10) do
      health = Tracebin::SystemHealthSample.new process: :worker
      ::Tracebin::Patches.handle_event :sidekiq_health, health
    end

    @tracebin_task.execute

    run_without_tracebin
  end

  def stop
    @tracebin_task.shutdown

    stop_without_tracebin
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracebin-0.0.13 lib/tracebin/patches/sidekiq_health.rb
tracebin-0.0.12 lib/tracebin/patches/sidekiq_health.rb
tracebin-0.0.11 lib/tracebin/patches/sidekiq_health.rb
tracebin-0.0.10 lib/tracebin/patches/sidekiq_health.rb
tracebin-0.0.9 lib/tracebin/patches/sidekiq_health.rb
tracebin-0.0.8 lib/tracebin/patches/sidekiq_health.rb