Class: Contrast::Agent::Reporting::Settings::Sampling
- Defined in:
- lib/contrast/agent/reporting/settings/sampling.rb
Overview
Sampling controls for the Assess Features provided by TeamServer
Instance Attribute Summary collapse
-
#baseline ⇒ Integer
readonly
The number of baseline requests to take before switching to sampling for the window.
-
#enabled ⇒ Boolean
readonly
If the sampling feature should be used or not.
-
#request_frequency ⇒ Integer
readonly
The number of requests to skip before observing during the sampling window after the baseline.
-
#response_frequency ⇒ Integer
readonly
The number of responses to skip before observing during the sampling window after the baseline.
-
#window_ms ⇒ Integer
readonly
The length of time for which the sample period is valid, in ms.
Instance Method Summary collapse
-
#initialize(hsh) ⇒ Sampling
constructor
A new instance of Sampling.
- #to_controlled_hash ⇒ Object
Constructor Details
#initialize(hsh) ⇒ Sampling
Returns a new instance of Sampling.
25 26 27 28 29 30 31 32 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 25 def initialize hsh @baseline = hsh[:baseline] # NG endpoints vs non-ng @enabled = hsh[:enabled] || hsh[:enable] @request_frequency = hsh[:frequency] || hsh[:request_frequency] @response_frequency = hsh[:responseFrequency] || hsh[:response_frequency] @window_ms = hsh[:window] || hsh[:window_ms] end |
Instance Attribute Details
#baseline ⇒ Integer (readonly)
Returns The number of baseline requests to take before switching to sampling for the window.
13 14 15 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 13 def baseline @baseline end |
#enabled ⇒ Boolean (readonly)
Returns If the sampling feature should be used or not.
15 16 17 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 15 def enabled @enabled end |
#request_frequency ⇒ Integer (readonly)
Returns The number of requests to skip before observing during the sampling window after the baseline.
18 19 20 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 18 def request_frequency @request_frequency end |
#response_frequency ⇒ Integer (readonly)
Returns The number of responses to skip before observing during the sampling window after the baseline.
21 22 23 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 21 def response_frequency @response_frequency end |
#window_ms ⇒ Integer (readonly)
Returns The length of time for which the sample period is valid, in ms.
23 24 25 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 23 def window_ms @window_ms end |
Instance Method Details
#to_controlled_hash ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/contrast/agent/reporting/settings/sampling.rb', line 34 def to_controlled_hash { baseline: baseline, enabled: enabled, frequency: request_frequency, responseFrequency: response_frequency, window: window_ms } end |