lib/contrast/config/assess_configuration.rb in contrast-agent-6.4.0 vs lib/contrast/config/assess_configuration.rb in contrast-agent-6.5.0
- old
+ new
@@ -13,10 +13,14 @@
# @return [Boolean, nil]
attr_accessor :enable
attr_writer :enable_scan_response, :enable_dynamic_sources, :sampling, :rules, :stacktraces
DEFAULT_STACKTRACES = 'ALL'
+ DEFAULT_MAX_SOURCE_EVENTS = 50_000
+ DEFAULT_MAX_PROPAGATION_EVENTS = 50_000
+ DEFAULT_MAX_RULE_REPORTED = 50_000
+ DEFAULT_MAX_RULE_TIME_THRESHOLD = 300_000
def initialize hsh = {}
return unless hsh
@enable = hsh[:enable]
@@ -25,10 +29,14 @@
@enable_dynamic_sources = hsh[:enable_dynamic_sources]
@enable_original_object = hsh[:enable_original_object]
@sampling = Contrast::Config::SamplingConfiguration.new(hsh[:sampling])
@rules = Contrast::Config::AssessRulesConfiguration.new(hsh[:rules])
@stacktraces = hsh[:stacktraces]
+ @max_context_source_events = hsh[:max_context_source_events]
+ @max_propagation_events = hsh[:max_propagation_events]
+ @max_rule_reported = hsh[:max_rule_reported]
+ @time_limit_threshold = hsh[:time_limit_threshold]
end
# @return [Boolean, true]
def enable_scan_response
@enable_scan_response.nil? ? true : @enable_scan_response
@@ -55,9 +63,29 @@
end
# @return [String] stacktrace level
def stacktraces
@stacktraces ||= DEFAULT_STACKTRACES
+ end
+
+ # @return [int] max number of context source events in single request
+ def max_context_source_events
+ @max_context_source_events ||= DEFAULT_MAX_SOURCE_EVENTS
+ end
+
+ # @return [int] max number of propagation events in single request
+ def max_propagation_events
+ @max_propagation_events ||= DEFAULT_MAX_PROPAGATION_EVENTS
+ end
+
+ # @return [int] max number of rules reported within time_limit_threshold
+ def max_rule_reported
+ @max_rule_reported ||= DEFAULT_MAX_RULE_REPORTED
+ end
+
+ # @return [int] max ms threshold for reporting rules
+ def time_limit_threshold
+ @time_limit_threshold ||= DEFAULT_MAX_RULE_TIME_THRESHOLD
end
end
end
end