vendor/bundle/ruby/2.3.0/gems/sqreen-1.10.5/lib/sqreen/call_countable.rb
# Hook the necessary callback function
# The module being decorated is expected to have a
# record_observation & rulespack_id & rule_name method available (like RuleCallback)
#
# @param count [Hash] hash of callback names => count
Hook the necessary callback function
The module being decorated is expected to have a
record_observation & rulespack_id & rule_name method available (like RuleCallback)
Hook the necessary callback function The module being decorated is expected to have a record_observation & rulespack_id & rule_name method available ( like RuleCallback )
def count_calls(what)
      return unless @call_count_interval > 0
      new_value = (@call_counts[what] += 1)
      return unless new_value % call_count_interval == 0
      @call_counts[what] = 0
      record_observation(COUNT_CALLS, @call_count_names[what], new_value)
    end
def count_calls ( what ) return unless @call_count_interval > 0 new_value = ( @call_counts [ what ] += 1 ) return unless new_value % call_count_interval == 0 @call_counts [ what ] = 0 record_observation ( COUNT_CALLS , @call_count_names [ what ] , new_value ) end
Hook the necessary callback function
The module being decorated is expected to have a
record_observation & rulespack_id & rule_name method available (like RuleCallback)
Hook the necessary callback function The module being decorated is expected to have a record_observation & rulespack_id & rule_name method available ( like RuleCallback )
what
<not_specific>
count
<not_specific>
hash of callback names => count
hash of callback names = > count