require 'active_support/concern' module Roqua module Probes module BaseProbe extend ActiveSupport::Concern class_methods do def enable new.tap do |probe| probe_sym = probe.class.to_s.to_sym Appsignal::Minutely.probes.register(probe_sym, probe) unless Appsignal::Minutely.probes[probe_sym] end end end # do not override me, implement probes by implementing the #run method def call run Appsignal.increment_counter("probe.call.completed.#{self.class.name.demodulize.underscore}", 1) end end end end