Sha256: ce56f6ecc8d5f832413c74165f203cb0b6993b8859295f5d7ff1d726f3d24f02

Contents?: true

Size: 534 Bytes

Versions: 12

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

require 'erb'

# Exporter for the https://github.com/ondrejbartas/sidekiq-cron
module Sidekiq
  module Prometheus
    module Exporter
      class Cron
        TEMPLATE = ERB.new(File.read(File.expand_path('templates/cron.erb', __dir__)))

        def self.available?
          defined?(Sidekiq::Cron)
        end

        def initialize
          @cron_jobs_count = Sidekiq::Cron::Job.count
        end

        def to_s
          TEMPLATE.result(binding).chomp!
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sidekiq-prometheus-exporter-0.2.1 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.2.0 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.17 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.16 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.15 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.14 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.13 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.12 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.11 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.10 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.9 lib/sidekiq/prometheus/exporter/cron.rb
sidekiq-prometheus-exporter-0.1.8 lib/sidekiq/prometheus/exporter/cron.rb