Class: Contrast::Agent::Reporting::Settings::AssessServerFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/settings/assess_server_feature.rb

Overview

Application level settings for the Assess featureset. Used for the FeatureSet TS response

Constant Summary collapse

REPORT_STACKTRACES =
%w[ALL SOME NONE].cs__freeze

Instance Method Summary collapse

Instance Method Details

#enabled=(enabled) ⇒ Object

Set the enabled

Parameters:

  • enabled (Boolean)


30
31
32
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 30

def enabled= enabled
  @_enabled = enabled
end

#enabled?Boolean

Indicate if the assess feature set is enabled for this server or not.

Returns:

  • (Boolean)


22
23
24
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 22

def enabled?
  @_enabled
end

#report_stacktracesString

Returns ALL, SOME, NONE.

Returns:

  • (String)

    ALL, SOME, NONE



35
36
37
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 35

def report_stacktraces
  @_report_stacktraces
end

#report_stacktraces=(level) ⇒ String

Returns ALL, SOME, NONE.

Returns:

  • (String)

    ALL, SOME, NONE



40
41
42
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 40

def report_stacktraces= level
  @_report_stacktraces = level if REPORT_STACKTRACES.include?(level)
end

#samplingContrast::Agent::Reporting::Settings::Sampling

Used to control the sampling feature in the agent.



47
48
49
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 47

def sampling
  @_sampling ||= Contrast::Agent::Reporting::Settings::Sampling.new({})
end

#sampling=(sampling) ⇒ Contrast::Agent::Reporting::Settings::Sampling

set sampling

}

Parameters:

  • sampling (Hash<AssessSampling>)

    Hash of AssessSampling: { baseline [Integer] The number of baseline requests to take before switching to sampling

    for the window.
    

    enabled [Boolean] If the sampling feature should be used or not. frequency [Integer] The number of requests to skip before observing during the sampling

    window after the baseline.
    

    responseFrequency [Integer] window [Integer]

Returns:



63
64
65
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 63

def sampling= sampling
  @_sampling = Contrast::Agent::Reporting::Settings::Sampling.new(sampling) if sampling.is_a?(Hash)
end

#sanitizersObject

The sanitizers defined by the user for use by the agent on this server for this organization.



70
71
72
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 70

def sanitizers
  @_sanitizers ||= []
end

#sanitizers=(sanitizers_array) ⇒ Object

set sanitizer

Parameters:



78
79
80
81
82
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 78

def sanitizers= sanitizers_array
  Contrast::Agent::Reporting::Settings::Helpers.array_to_iv(Contrast::Agent::Reporting::Settings::Sanitizer,
                                                            sanitizers,
                                                            sanitizers_array)
end

#to_controlled_hashObject



101
102
103
104
105
106
107
108
109
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 101

def to_controlled_hash
  {
      enabled: enabled?,
      sampling: sampling.to_controlled_hash,
      report_stacktraces: report_stacktraces, # used with ServerSettings only
      sanitizers: sanitizers.map(&:to_controlled_hash),
      validators: validators.map(&:to_controlled_hash)
  }.compact
end

#validatorsObject

The validators defined by the user for use by the agent on this server for this organization.



87
88
89
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 87

def validators
  @_validators ||= []
end

#validators=(validators_array) ⇒ Object

set validators

Parameters:



95
96
97
98
99
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 95

def validators= validators_array
  Contrast::Agent::Reporting::Settings::Helpers.array_to_iv(Contrast::Agent::Reporting::Settings::Validator,
                                                            validators,
                                                            validators_array)
end