Skip to content

Instantly share code, notes, and snippets.

@paulfri
Created July 16, 2019 18:31
Show Gist options
  • Save paulfri/aa6d4acd659f99039987cde3c1716336 to your computer and use it in GitHub Desktop.
Save paulfri/aa6d4acd659f99039987cde3c1716336 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
class Sidekiq::Middleware::Server::StatsdQueueSize
def initialize(_options = nil)
@statsd = Sidekiq::Pro.metrics
end
def call(_worker, _msg, queue)
@statsd.gauge "queue.#{queue}.size", Sidekiq::Queue.new(queue).size
yield
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment