Class: Txnap::Configuration
- Inherits:
-
Object
- Object
- Txnap::Configuration
- Defined in:
- lib/txnap/configuration.rb
Constant Summary collapse
- MODES =
%i[log raise].freeze
- CAPTURE_CALL_SITES =
%i[always sampled off].freeze
Instance Attribute Summary collapse
-
#capture_call_sites ⇒ Object
Returns the value of attribute capture_call_sites.
-
#gap_threshold ⇒ Object
Returns the value of attribute gap_threshold.
-
#ignore_if ⇒ Object
Returns the value of attribute ignore_if.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#min_transaction_duration ⇒ Object
Returns the value of attribute min_transaction_duration.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#only_with_locks ⇒ Object
Returns the value of attribute only_with_locks.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 23 24 |
# File 'lib/txnap/configuration.rb', line 16 def initialize @mode = :log @gap_threshold = 0.1 @min_transaction_duration = 0.0 @only_with_locks = false @capture_call_sites = :always @ignore_if = nil @logger = nil end |
Instance Attribute Details
#capture_call_sites ⇒ Object
Returns the value of attribute capture_call_sites.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def capture_call_sites @capture_call_sites end |
#gap_threshold ⇒ Object
Returns the value of attribute gap_threshold.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def gap_threshold @gap_threshold end |
#ignore_if ⇒ Object
Returns the value of attribute ignore_if.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def ignore_if @ignore_if end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def logger @logger end |
#min_transaction_duration ⇒ Object
Returns the value of attribute min_transaction_duration.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def min_transaction_duration @min_transaction_duration end |
#mode ⇒ Object
Returns the value of attribute mode.
14 15 16 |
# File 'lib/txnap/configuration.rb', line 14 def mode @mode end |
#only_with_locks ⇒ Object
Returns the value of attribute only_with_locks.
8 9 10 |
# File 'lib/txnap/configuration.rb', line 8 def only_with_locks @only_with_locks end |
Instance Method Details
#validate! ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/txnap/configuration.rb', line 30 def validate! validate_choice!(:mode, mode, MODES) validate_non_negative_number!(:gap_threshold, gap_threshold) validate_non_negative_number!(:min_transaction_duration, min_transaction_duration) validate_boolean!(:only_with_locks, only_with_locks) validate_choice!(:capture_call_sites, capture_call_sites, CAPTURE_CALL_SITES) validate_callable!(:ignore_if, ignore_if) self end |