Class: OneApm::Collector::Commands::XraySession
- Inherits:
-
Object
- Object
- OneApm::Collector::Commands::XraySession
- Extended by:
- Forwardable
- Defined in:
- lib/one_apm/collector/commands/xray_session.rb
Instance Attribute Summary collapse
-
#command_arguments ⇒ Object
readonly
Returns the value of attribute command_arguments.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key_transaction_name ⇒ Object
readonly
Returns the value of attribute key_transaction_name.
-
#requested_trace_count ⇒ Object
readonly
Returns the value of attribute requested_trace_count.
-
#sample_period ⇒ Object
readonly
Returns the value of attribute sample_period.
-
#xray_session_name ⇒ Object
readonly
Returns the value of attribute xray_session_name.
Instance Method Summary collapse
- #activate ⇒ Object
- #active? ⇒ Boolean
- #deactivate ⇒ Object
- #finished? ⇒ Boolean
-
#initialize(command_arguments) ⇒ XraySession
constructor
A new instance of XraySession.
- #requested_period ⇒ Object
- #run_profiler? ⇒ Boolean
Constructor Details
permalink #initialize(command_arguments) ⇒ XraySession
Returns a new instance of XraySession.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 15 def initialize(command_arguments) @command_arguments = command_arguments @id = command_arguments.fetch("x_ray_id", nil) @xray_session_name = command_arguments.fetch("xray_session_name", "") @key_transaction_name = command_arguments.fetch("key_transaction_name", "") @requested_trace_count = command_arguments.fetch("requested_trace_count", 100) @duration = command_arguments.fetch("duration", 86400) @sample_period = command_arguments.fetch("sample_period", 0.1) @run_profiler = command_arguments.fetch("run_profiler", true) end |
Instance Attribute Details
permalink #command_arguments ⇒ Object (readonly)
Returns the value of attribute command_arguments.
11 12 13 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 11 def command_arguments @command_arguments end |
permalink #duration ⇒ Object (readonly)
Returns the value of attribute duration.
12 13 14 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 12 def duration @duration end |
permalink #id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 11 def id @id end |
permalink #key_transaction_name ⇒ Object (readonly)
Returns the value of attribute key_transaction_name.
12 13 14 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 12 def key_transaction_name @key_transaction_name end |
permalink #requested_trace_count ⇒ Object (readonly)
Returns the value of attribute requested_trace_count.
12 13 14 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 12 def requested_trace_count @requested_trace_count end |
permalink #sample_period ⇒ Object (readonly)
Returns the value of attribute sample_period.
12 13 14 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 12 def sample_period @sample_period end |
permalink #xray_session_name ⇒ Object (readonly)
Returns the value of attribute xray_session_name.
12 13 14 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 12 def xray_session_name @xray_session_name end |
Instance Method Details
permalink #activate ⇒ Object
[View source]
34 35 36 37 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 34 def activate @active = true @start_time = Time.now end |
permalink #active? ⇒ Boolean
26 27 28 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 26 def active? @active end |
permalink #deactivate ⇒ Object
[View source]
39 40 41 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 39 def deactivate @active = false end |
permalink #finished? ⇒ Boolean
47 48 49 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 47 def finished? @start_time + @duration < Time.now end |
permalink #requested_period ⇒ Object
[View source]
43 44 45 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 43 def requested_period @sample_period end |
permalink #run_profiler? ⇒ Boolean
30 31 32 |
# File 'lib/one_apm/collector/commands/xray_session.rb', line 30 def run_profiler? @run_profiler && OneApm::Manager.config[:'xray_session.allow_profiles'] end |