get_matched_rule

in lib/aws-xray-sdk/sampling/rule_cache.rb [16:25]


    def get_matched_rule(sampling_req, now: Time.now.to_i)
      return nil if expired?(now)
      matched = nil
      rules.each do |rule|
        matched = rule if matched.nil? && rule.applies?(sampling_req)
        matched = rule if matched.nil? && rule.default?
      end
      matched
    end