Sha256: b9bb19dbbedd76dadfb989b77d644aaa14ea2598d6e6ca517a482a2b70166016
Contents?: true
Size: 589 Bytes
Versions: 13
Compression:
Stored size: 589 Bytes
Contents
module PrometheusExporter::Instrumentation class Sidekiq def initialize(client: nil) @client = client || PrometheusExporter::Client.default end def call(worker, msg, queue) success = false start = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) result = yield success = true result ensure duration = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - start @client.send_json( type: "sidekiq", name: worker.class.to_s, success: success, duration: duration ) end end end
Version data entries
13 entries across 13 versions & 1 rubygems