oboe-heroku 0.9.15.6 → 0.9.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77b525534ab23bff7247bc648e85de1e53542e6c
4
- data.tar.gz: d141e8a197b1cdb1bac0ba87a5303faa3ad3c57e
3
+ metadata.gz: bc6c39cb8e4cc43a47e7efbe89d3a8094f32640e
4
+ data.tar.gz: d1d5f2fe48c8143d07055e9616c030553b7dae3c
5
5
  SHA512:
6
- metadata.gz: aa1eabb362855ec18c834b9f191c1c7cb466fb31896bb2007d44a378b8df5296ba64e19e3affaedf53f9c50a30bc1455b203791a489e4a5c1f8e1bd8ed1de135
7
- data.tar.gz: d44d39fa3854a20d79cdf5a31c2e57b92efa1e965411d17415f6b07d3b35b8320f420eb127d6aad9e85c9e2873f24c8863e13b5ad1e280a60231db503a6a0b17
6
+ metadata.gz: df68a3e633f1464ff52e27815857dd6200282c4a805a4704bab14231218ea949c051d77f952d88e13eace53e0fe03cf5f3c3d078b173abaf89f80b49ab4afa36
7
+ data.tar.gz: 42322e7bf47284592a572761f7a8ffef1af8bd3147e07e93c0b1ec97571b7930c418569821f0460cf48d2869647630976a2708db1abd7d5c6df3cfcf77531c91
@@ -22,16 +22,21 @@ SAMPLE_SOURCE_MASK = 0b1111000000000000000000000000
22
22
  ZERO_SAMPLE_RATE_MASK = 0b1111000000000000000000000000
23
23
  ZERO_SAMPLE_SOURCE_MASK = 0b0000111111111111111111111111
24
24
 
25
+ ##
26
+ # This module is the base module for the various implementations of Oboe reporting.
27
+ # Current variations as of 2014-09-10 are a c-extension, JRuby (using TraceView Java
28
+ # instrumentation) and a Heroku c-extension (with embedded tracelyzer)
25
29
  module OboeBase
26
30
  extend ::Oboe::ThreadLocal
27
31
 
28
32
  attr_accessor :reporter
33
+ attr_accessor :collector
29
34
  attr_accessor :loaded
30
- attr_accessor :sample_source
31
- attr_accessor :sample_rate
32
- thread_local :layer_op
35
+ thread_local :sample_source
36
+ thread_local :sample_rate
37
+ thread_local :layer_op
33
38
 
34
- def self.included(cls)
39
+ def self.included(_)
35
40
  self.loaded = true
36
41
  end
37
42
 
@@ -43,26 +48,46 @@ module OboeBase
43
48
  end
44
49
  end
45
50
 
51
+ ##
52
+ # Returns true if the tracing_mode is set to always.
53
+ # False otherwise
54
+ #
46
55
  def always?
47
- Oboe::Config[:tracing_mode].to_s == "always"
56
+ Oboe::Config[:tracing_mode].to_s == 'always'
48
57
  end
49
58
 
59
+ ##
60
+ # Returns true if the tracing_mode is set to never.
61
+ # False otherwise
62
+ #
50
63
  def never?
51
- Oboe::Config[:tracing_mode].to_s == "never"
64
+ Oboe::Config[:tracing_mode].to_s == 'never'
52
65
  end
53
66
 
67
+ ##
68
+ # Returns true if the tracing_mode is set to always or through.
69
+ # False otherwise
70
+ #
54
71
  def passthrough?
55
- ["always", "through"].include?(Oboe::Config[:tracing_mode])
72
+ %w(always through).include?(Oboe::Config[:tracing_mode])
56
73
  end
57
74
 
75
+ ##
76
+ # Returns true if the tracing_mode is set to through.
77
+ # False otherwise
78
+ #
58
79
  def through?
59
- Oboe::Config[:tracing_mode] == "through"
80
+ Oboe::Config[:tracing_mode] == 'through'
60
81
  end
61
82
 
83
+ ##
84
+ # Returns true if we are currently tracing a request
85
+ # False otherwise
86
+ #
62
87
  def tracing?
63
88
  return false unless Oboe.loaded
64
89
 
65
- Oboe::Context.isValid and not Oboe.never?
90
+ Oboe::Context.isValid && !Oboe.never?
66
91
  end
67
92
 
68
93
  def log(layer, label, options = {})
@@ -71,36 +96,45 @@ module OboeBase
71
96
  end
72
97
 
73
98
  def heroku?
74
- true
99
+ ENV['TRACEVIEW_URL']
75
100
  end
76
101
 
102
+ ##
103
+ # Determines if we are running under a forking webserver
104
+ #
77
105
  def forking_webserver?
78
- (defined?(::Unicorn) and ($0 =~ /unicorn/i)) ? true : false
106
+ (defined?(::Unicorn) && ($PROGRAM_NAME =~ /unicorn/i)) ? true : false
107
+ end
108
+
109
+ ##
110
+ # Indicates whether a supported framework is in use
111
+ # or not
112
+ #
113
+ def framework?
114
+ defined?(::Rails) or defined?(::Sinatra) or defined?(::Padrino) or defined?(::Grape)
79
115
  end
80
116
 
81
117
  ##
82
118
  # These methods should be implemented by the descendants
83
119
  # (Oboe_metal, Oboe_metal (JRuby), Heroku_metal)
84
120
  #
85
- def sample?(opts = {})
86
- raise "sample? should be implemented by metal layer."
121
+ def sample?(_opts = {})
122
+ fail 'sample? should be implemented by metal layer.'
87
123
  end
88
124
 
89
- def log(layer, label, options = {})
90
- raise "log should be implemented by metal layer."
125
+ def log(_layer, _label, _options = {})
126
+ fail 'log should be implemented by metal layer.'
91
127
  end
92
128
 
93
- def set_tracing_mode(mode)
94
- raise "set_tracing_mode should be implemented by metal layer."
129
+ def set_tracing_mode(_mode)
130
+ fail 'set_tracing_mode should be implemented by metal layer.'
95
131
  end
96
132
 
97
- def set_sample_rate(rate)
98
- raise "set_sample_rate should be implemented by metal layer."
133
+ def set_sample_rate(_rate)
134
+ fail 'set_sample_rate should be implemented by metal layer.'
99
135
  end
100
-
101
136
  end
102
137
 
103
138
  module Oboe
104
139
  extend OboeBase
105
140
  end
106
-
@@ -2,8 +2,8 @@ module OboeHeroku
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 9
5
- PATCH = 15
6
- BUILD = 6
5
+ PATCH = 16
6
+ BUILD = 1
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
data/lib/oboe-heroku.rb CHANGED
@@ -34,4 +34,3 @@ rescue Exception => e
34
34
  $stderr.puts e.backtrace.join("\n")
35
35
  end
36
36
  end
37
-
data/oboe-heroku.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.extensions = ['ext/oboe_metal/extconf.rb']
22
22
 
23
- s.add_dependency(%q<oboe>, [">= 2.7.1.7"])
23
+ s.add_dependency(%q<oboe>, [">= 2.7.2.2"])
24
24
 
25
25
  s.add_development_dependency 'rake', '>= 0'
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oboe-heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15.6
4
+ version: 0.9.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-08 00:00:00.000000000 Z
12
+ date: 2014-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oboe
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 2.7.1.7
20
+ version: 2.7.2.2
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 2.7.1.7
27
+ version: 2.7.2.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement