vendor/bundle/ruby/2.3.0/gems/sqreen-1.10.5/lib/sqreen/instrumentation.rb
# Instrument the application code using the rules
# @param rules [Array<Hash>] Rules to instrument
# @param metrics_engine [MetricsStore] Metric storage facility
Instrument the application code using the rules
Instrument the application code using the rules
def instrument!(rules, framework)
      verifier = nil
      if Sqreen.features['rules_signature']         &&
         Sqreen.config_get(:rules_verify_signature) == true &&
         !defined?(::JRUBY_VERSION)
        verifier = Sqreen::SqreenSignedVerifier.new
      else
        Sqreen.log.debug('Rules signature is not enabled')
      end
      remove_all_callbacks 
      rules.each do |rule|
        rcb = Sqreen::Rules.cb_from_rule(rule, self, metrics_engine, verifier)
        next unless rcb
        rcb.framework = framework
        add_callback(rcb)
      end
      Sqreen.instrumentation_ready = true
    end
def instrument! ( rules , framework ) verifier = nil if Sqreen . features [ 'rules_signature' ] && Sqreen . config_get ( :rules_verify_signature ) == true && ! defined? ( :: JRUBY_VERSION ) verifier = Sqreen :: SqreenSignedVerifier . new else Sqreen . log . debug ( 'Rules signature is not enabled' ) end remove_all_callbacks rules . each do | rule | rcb = Sqreen :: Rules . cb_from_rule ( rule , self , metrics_engine , verifier ) next unless rcb rcb . framework = framework add_callback ( rcb ) end Sqreen . instrumentation_ready = true end
Instrument the application code using the rules
Instrument the application code using the rules
# Force cb tree to be empty before instrumenting
rules
Rules to instrument
Rules to instrument
framework
<not_specific>
metrics_engine
<not_specific>
Metric storage facility
Metric storage facility