Sha256: 06bf2cbafcb07ab40ff4cf80ce39d9f71fd0ee4975a5e6044943726b02eeb89e

Contents?: true

Size: 1009 Bytes

Versions: 7

Compression:

Stored size: 1009 Bytes

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

module Contrast
  module Config
    # Common Configuration settings. Those in this section pertain to the sampling functionality of the Agent.
    class SamplingConfiguration
      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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-6.5.0 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.4.0 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.3.0 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.2.0 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.1.2 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.1.1 lib/contrast/config/sampling_configuration.rb
contrast-agent-6.1.0 lib/contrast/config/sampling_configuration.rb