Sha256: d8af01640f1d928c39aa828e7229b21809c02768d7f81e832e645de40c6f5ee6

Contents?: true

Size: 1.65 KB

Versions: 16

Compression:

Stored size: 1.65 KB

Contents

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

require 'contrast/utils/object_share'

module Contrast
  module Agent
    module Reporting
      module Settings
        # Sampling controls for the Assess Features provided by TeamServer
        class Sampling
          # @return [Integer] The number of baseline requests to take before switching to sampling for the window.
          attr_reader :baseline
          # @return [Boolean] If the sampling feature should be used or not.
          attr_reader :enabled
          # @return [Integer] The number of requests to skip before observing during the sampling window after the
          #   baseline.
          attr_reader :request_frequency
          # @return [Integer] The number of responses to skip before observing during the sampling window after the
          #  baseline.
          attr_reader :response_frequency
          # @return [Integer] The length of time for which the sample period is valid, in ms.
          attr_reader :window_ms

          def initialize hsh
            @baseline = hsh[:baseline]
            @enabled = hsh[:enabled]
            @request_frequency = hsh[:frequency]
            @response_frequency = hsh[:responseFrequency]
            @window_ms = hsh[:window]
          end

          def to_controlled_hash
            {
                baseline: baseline,
                enabled: enabled,
                frequency: request_frequency,
                responseFrequency: response_frequency,
                window: window_ms
            }
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
contrast-agent-6.11.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.10.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.9.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.8.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.7.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.5 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.4 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.3 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.2 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.1 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.6.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.5.1 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.5.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.4.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.3.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.2.0 lib/contrast/agent/reporting/settings/sampling.rb