Module: OboeBase
- Included in:
- Oboe
- Defined in:
- lib/oboe-heroku/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.
43 44 45 |
# File 'lib/oboe-heroku/base.rb', line 43 def loaded @loaded end |
#reporter ⇒ Object
Returns the value of attribute reporter.
42 43 44 |
# File 'lib/oboe-heroku/base.rb', line 42 def reporter @reporter end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
45 46 47 |
# File 'lib/oboe-heroku/base.rb', line 45 def sample_rate @sample_rate end |
#sample_source ⇒ Object
Returns the value of attribute sample_source.
44 45 46 |
# File 'lib/oboe-heroku/base.rb', line 44 def sample_source @sample_source end |
Class Method Details
.included(cls) ⇒ Object
47 48 49 |
# File 'lib/oboe-heroku/base.rb', line 47 def self.included(cls) self.loaded = true end |
Instance Method Details
#always? ⇒ Boolean
51 52 53 |
# File 'lib/oboe-heroku/base.rb', line 51 def always? Oboe::Config[:tracing_mode].to_s == "always" end |
#forking_webserver? ⇒ Boolean
82 83 84 |
# File 'lib/oboe-heroku/base.rb', line 82 def forking_webserver? (defined?(::Unicorn) and ($0 =~ /unicorn/i)) ? true : false end |
#heroku? ⇒ Boolean
78 79 80 |
# File 'lib/oboe-heroku/base.rb', line 78 def heroku? true end |
#log(layer, label, options = {}) ⇒ Object
73 74 75 76 |
# File 'lib/oboe-heroku/base.rb', line 73 def log(layer, label, = {}) # WARN: Oboe.log will be deprecated in a future release. Please use Oboe::API.log instead. Oboe::API.log(layer, label, ) end |
#never? ⇒ Boolean
55 56 57 |
# File 'lib/oboe-heroku/base.rb', line 55 def never? Oboe::Config[:tracing_mode].to_s == "never" end |
#passthrough? ⇒ Boolean
59 60 61 |
# File 'lib/oboe-heroku/base.rb', line 59 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)
90 91 92 |
# File 'lib/oboe-heroku/base.rb', line 90 def sample?(opts = {}) raise "sample? should be implemented by metal layer." end |
#set_sample_rate(rate) ⇒ Object
102 103 104 |
# File 'lib/oboe-heroku/base.rb', line 102 def set_sample_rate(rate) raise "set_sample_rate should be implemented by metal layer." end |
#set_tracing_mode(mode) ⇒ Object
98 99 100 |
# File 'lib/oboe-heroku/base.rb', line 98 def set_tracing_mode(mode) raise "set_tracing_mode should be implemented by metal layer." end |
#through? ⇒ Boolean
63 64 65 |
# File 'lib/oboe-heroku/base.rb', line 63 def through? Oboe::Config[:tracing_mode] == "through" end |
#tracing? ⇒ Boolean
67 68 69 70 71 |
# File 'lib/oboe-heroku/base.rb', line 67 def tracing? return false unless Oboe.loaded Oboe::Context.isValid and not Oboe.never? end |