def sample_request?(sampling_req)
      start unless @started
      now = Time.now.to_i
      if sampling_req.nil?
        sampling_req = { service_type: @origin } if @origin
      elsif !sampling_req.key?(:service_type)
        sampling_req[:service_type] = @origin if @origin
      end

      matched_rule = @cache.get_matched_rule(sampling_req, now: now)
      if !matched_rule.nil?
        logger.debug %(Rule #{matched_rule.name} is selected to make a sampling decision.')
        process_matched_rule(matched_rule, now)
      else
        logger.warn %(No effective centralized sampling rule match. Fallback to local rules.)
        @local_sampler.sample_request?(sampling_req)
      end
    end
def sample_request?(sampling_req)
      start unless @started
      now = Time.now.to_i
      if sampling_req.nil?
        sampling_req = { service_type: @origin } if @origin
      elsif !sampling_req.key?(:service_type)
        sampling_req[:service_type] = @origin if @origin
      end

      matched_rule = @cache.get_matched_rule(sampling_req, now: now)
      if !matched_rule.nil?
        logger.debug %(Rule #{matched_rule.name} is selected to make a sampling decision.')
        process_matched_rule(matched_rule, now)
      else
        logger.warn %(No effective centralized sampling rule match. Fallback to local rules.)
        @local_sampler.sample_request?(sampling_req)
      end
    end
Return the rule name if it decides to sample based on
 a service sampling rule matching. If there is no match
 it will fallback to local defined sampling rules.