Sha256: 0267a61f8a607c41cc8381ad3f1644e334c8d92b69a88c58b6446b4b84f43a65

Contents?: true

Size: 1.65 KB

Versions: 13

Compression:

Stored size: 1.65 KB

Contents

# Copyright (c) 2023 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

13 entries across 13 versions & 1 rubygems

Version Path
contrast-agent-7.3.2 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-7.3.1 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-7.3.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-7.2.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-7.1.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-7.0.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.15.3 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.15.2 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.15.1 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.15.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.14.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.13.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.12.0 lib/contrast/agent/reporting/settings/sampling.rb