module Librato::Rails::Subscribers

defines basic context that all librato-rails subscribers will run in

Public Class Methods

collector() click to toggle source

make collector object directly available, it won't be changing

# File lib/librato/rails/subscribers.rb, line 10
def self.collector
  @collector ||= Librato.tracker.collector
end
inherit_watches(base, descendant) click to toggle source
# File lib/librato/rails/subscribers.rb, line 27
def self.inherit_watches(base, descendant)
  @watches ||= []
  @watches << descendant.freeze if @watches.include?(base)
end
watch_controller_action(controller, action) click to toggle source
# File lib/librato/rails/subscribers.rb, line 14
def self.watch_controller_action(controller, action)
  @watches ||= []

  watch =
    if action == :all
      "#{controller}".freeze
    else
      "#{controller}##{action}".freeze
    end

  @watches << watch
end