Class: Contrast::Agent::Reporting::Settings::AssessServerFeature
- 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
-
#enabled=(enabled) ⇒ Object
Set the enabled.
-
#enabled? ⇒ Boolean
Indicate if the assess feature set is enabled for this server or not.
-
#report_stacktraces ⇒ String
ALL, SOME, NONE.
-
#report_stacktraces=(level) ⇒ String
ALL, SOME, NONE.
-
#sampling ⇒ Contrast::Agent::Reporting::Settings::Sampling
Used to control the sampling feature in the agent.
-
#sampling=(sampling) ⇒ Contrast::Agent::Reporting::Settings::Sampling
set sampling.
-
#sanitizers ⇒ Object
The sanitizers defined by the user for use by the agent on this server for this organization.
-
#sanitizers=(sanitizers_array) ⇒ Object
set sanitizer.
- #to_controlled_hash ⇒ Object
-
#validators ⇒ Object
The validators defined by the user for use by the agent on this server for this organization.
-
#validators=(validators_array) ⇒ Object
set validators.
Instance Method Details
#enabled=(enabled) ⇒ Object
Set the enabled
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.
22 23 24 |
# File 'lib/contrast/agent/reporting/settings/assess_server_feature.rb', line 22 def enabled? @_enabled end |
#report_stacktraces ⇒ String
Returns 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.
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 |
#sampling ⇒ Contrast::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
}
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 |
#sanitizers ⇒ Object
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
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_hash ⇒ Object
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 |
#validators ⇒ Object
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
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 |