Sha256: 784d459c039f27d01c56c5a9ba81612989a89abf166dd49aa005db1de93d74b0

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 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
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contrast-agent-6.1.2 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.1.1 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.1.0 lib/contrast/agent/reporting/settings/sampling.rb
contrast-agent-6.0.0 lib/contrast/agent/reporting/settings/sampling.rb