Sha256: 8801ff5c2024dfd87037011daf4420de2a5770f1be71b3e46bbf799ecdbd73e9

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

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 < 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 = {}
        @enable = traverse_config(hsh, :enable)
        @baseline = traverse_config(hsh, :baseline)
        @request_frequency = traverse_config(hsh, :request_frequency)
        @response_frequency = traverse_config(hsh, :response_frequency)
        @window_ms = traverse_config(hsh, :window_ms)
      end

      # @return [Boolean, false]
      def enable
        !!@enable
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contrast-agent-6.0.0 lib/contrast/config/sampling_configuration.rb