Sha256: feff1bce418e8a4e926457854a1ebf7aa728762d08ad983c17e7d93969598fc1

Contents?: true

Size: 363 Bytes

Versions: 2

Compression:

Stored size: 363 Bytes

Contents

# frozen_string_literal: true

require 'sidekiq/api'

class Metrics
  QueueStats = Struct.new(:name, :size, :latency)

  def initialize
    @overview_stats = Sidekiq::Stats.new
    @queues_stats = queues_stats
  end

  private

  def queues_stats
    Sidekiq::Queue.all.map do |queue|
      QueueStats.new(queue.name, queue.size, queue.latency)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sidekiq-prometheus-exporter-0.1.3 lib/sidekiq/prometheus/exporter/metrics.rb
sidekiq-prometheus-exporter-0.1.2 lib/sidekiq/prometheus/exporter/metrics.rb