Module: OboeBase
- Included in:
- Oboe
- Defined in:
- lib/base.rb
Instance Attribute Summary collapse
-
#loaded ⇒ Object
Returns the value of attribute loaded.
-
#reporter ⇒ Object
Returns the value of attribute reporter.
-
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
-
#sample_source ⇒ Object
Returns the value of attribute sample_source.
Class Method Summary collapse
Instance Method Summary collapse
- #always? ⇒ Boolean
- #forking_webserver? ⇒ Boolean
- #heroku? ⇒ Boolean
- #log(layer, label, options = {}) ⇒ Object
- #never? ⇒ Boolean
- #passthrough? ⇒ Boolean
-
#sample?(opts = {}) ⇒ Boolean
These methods should be implemented by the descendants (Oboe_metal, Oboe_metal (JRuby), Heroku_metal).
- #set_sample_rate(rate) ⇒ Object
- #set_tracing_mode(mode) ⇒ Object
- #through? ⇒ Boolean
- #tracing? ⇒ Boolean
Instance Attribute Details
#loaded ⇒ Object
Returns the value of attribute loaded.
27 28 29 |
# File 'lib/base.rb', line 27 def loaded @loaded end |
#reporter ⇒ Object
Returns the value of attribute reporter.
26 27 28 |
# File 'lib/base.rb', line 26 def reporter @reporter end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
29 30 31 |
# File 'lib/base.rb', line 29 def sample_rate @sample_rate end |
#sample_source ⇒ Object
Returns the value of attribute sample_source.
28 29 30 |
# File 'lib/base.rb', line 28 def sample_source @sample_source end |
Class Method Details
.included(cls) ⇒ Object
31 32 33 |
# File 'lib/base.rb', line 31 def self.included(cls) self.loaded = true end |
Instance Method Details
#always? ⇒ Boolean
35 36 37 |
# File 'lib/base.rb', line 35 def always? Oboe::Config[:tracing_mode].to_s == "always" end |
#forking_webserver? ⇒ Boolean
65 66 67 |
# File 'lib/base.rb', line 65 def forking_webserver? (defined?(::Unicorn) and ($0 =~ /unicorn/i)) ? true : false end |
#heroku? ⇒ Boolean
61 62 63 |
# File 'lib/base.rb', line 61 def heroku? false end |
#log(layer, label, options = {}) ⇒ Object
57 58 59 |
# File 'lib/base.rb', line 57 def log(layer, label, = {}) Context.log(layer, label, = ) end |
#never? ⇒ Boolean
39 40 41 |
# File 'lib/base.rb', line 39 def never? Oboe::Config[:tracing_mode].to_s == "never" end |
#passthrough? ⇒ Boolean
43 44 45 |
# File 'lib/base.rb', line 43 def passthrough? ["always", "through"].include?(Oboe::Config[:tracing_mode]) end |
#sample?(opts = {}) ⇒ Boolean
These methods should be implemented by the descendants (Oboe_metal, Oboe_metal (JRuby), Heroku_metal)
73 74 75 |
# File 'lib/base.rb', line 73 def sample?(opts = {}) raise "sample? should be implemented by metal layer." end |
#set_sample_rate(rate) ⇒ Object
85 86 87 |
# File 'lib/base.rb', line 85 def set_sample_rate(rate) raise "set_sample_rate should be implemented by metal layer." end |
#set_tracing_mode(mode) ⇒ Object
81 82 83 |
# File 'lib/base.rb', line 81 def set_tracing_mode(mode) raise "set_tracing_mode should be implemented by metal layer." end |