Sha256: c44e7d369a90ac12289c98c55434b731056e1b1810c860f9398ec32090683d84

Contents?: true

Size: 398 Bytes

Versions: 14

Compression:

Stored size: 398 Bytes

Contents

require 'active_support'

module Vitals::Integrations::Notifications
  class Base
    def self.subscribe!
      subscriber = ActiveSupport::Notifications.subscribe(event_name, &method(:handle))

      subscriber
    end

    def self.handle
      raise "#handle not implemented"
    end

    def self.duration(started, finished)
      Vitals::Utils.sec_to_ms(finished - started)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vitals-0.12.0 lib/vitals/integrations/notifications/base.rb
vitals-0.11.1 lib/vitals/integrations/notifications/base.rb
vitals-0.11.0 lib/vitals/integrations/notifications/base.rb
vitals-0.10.1 lib/vitals/integrations/notifications/base.rb
vitals-0.10.0 lib/vitals/integrations/notifications/base.rb
vitals-0.9.1 lib/vitals/integrations/notifications/base.rb
vitals-0.9.0 lib/vitals/integrations/notifications/base.rb
vitals-0.8.1 lib/vitals/integrations/notifications/base.rb
vitals-0.8.0 lib/vitals/integrations/notifications/base.rb
vitals-0.7.0 lib/vitals/integrations/notifications/base.rb
vitals-0.6.0 lib/vitals/integrations/notifications/base.rb
vitals-0.5.0 lib/vitals/integrations/notifications/base.rb
vitals-0.4.0 lib/vitals/integrations/notifications/base.rb
vitals-0.3.0 lib/vitals/integrations/notifications/base.rb