Sha256: fab2aad6dc8154026396aedc96d6d1116eee8606c41891f73da461c48719f8db
Contents?: true
Size: 954 Bytes
Versions: 15
Compression:
Stored size: 954 Bytes
Contents
class Circuitbox class Notifier def initialize(service, partition=nil) @service = service @partition = partition end def notify(event) return unless notification_available? ActiveSupport::Notifications.instrument("circuit_#{event}", circuit: circuit_name) end def notify_warning(message) return unless notification_available? ActiveSupport::Notifications.instrument("circuit_warning", { circuit: circuit_name, message: message}) end def metric_gauge(gauge, value) return unless notification_available? ActiveSupport::Notifications.instrument("circuit_gauge", { circuit: circuit_name, gauge: gauge.to_s, value: value }) end private def circuit_name circuit_name = @service.to_s circuit_name += ":#{@partition}" if @partition circuit_name end def notification_available? defined? ActiveSupport::Notifications end end end
Version data entries
15 entries across 15 versions & 1 rubygems