lib/contrast/components/sampling.rb in contrast-agent-6.5.0 vs lib/contrast/components/sampling.rb in contrast-agent-6.5.1

- old
+ new

@@ -89,8 +89,37 @@ module InstanceMethods # :nodoc: include Contrast::Components::ComponentBase include Constants include ClassMethods end + + class Interface # :nodoc: + include InstanceMethods + include Contrast::Config::BaseConfiguration + + # @return [Integer, nil] + attr_reader :baseline + # @return [Integer, nil] + attr_reader :request_frequency + # @return [Integer, nil] + attr_reader :response_frequency + # @return [Integer, nil] + attr_reader :window_ms + + def initialize hsh = {} + return unless hsh + + @enable = hsh[:enable] + @baseline = hsh[:baseline] + @request_frequency = hsh[:request_frequency] + @response_frequency = hsh[:response_frequency] + @window_ms = hsh[:window_ms] + end + + # @return [Boolean, false] + def enable + !!@enable + end + end end end end