oboe-heroku 0.9.17.4 → 0.9.17.8

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: 3c91e362bef82bc73ca272c0c58ff1e3b5cd34bf
4
- data.tar.gz: e759d1afabd1393c399ed6a4b5274779df880dcf
3
+ metadata.gz: 10a4fdece58a3dfd1118d6f5e7ecf2a3c96c9660
4
+ data.tar.gz: 9fc13b8e1daf90aebb19c76a58b8b2184167c84d
5
5
  SHA512:
6
- metadata.gz: a01d74e37e4a503831328d1897ab21a81d4660c22d2ffd1b5f5f1fdbf31fde8da2534c20c790965cfffff77233b4a985fc1d8f6e5edefda654f1c1444e96b097
7
- data.tar.gz: d5a683440d9a113fa47c7554fe86c5141046a083d6850cc4401e7436d3e7f3d881e45a0982a994fcfce010b1bfd5ab9389109ec495dba72db40770bd293a3a6e
6
+ metadata.gz: aa3e0b46571bc2552906e3e04c67e7643d248f9a2facdfbbdcb1a3740142baa469b533a8053b989147c98a57abb6bf8715975b60592a3b520907854a18438400
7
+ data.tar.gz: 27bf470697791d254b776730cbd2f5930e841690759f23d0f0f299273809ff03b5fac848f77ed3c666a0944152df04f9f085ae963aef1a1dbd3a6052cf5deceb
data/lib/heroku_metal.rb CHANGED
@@ -45,24 +45,31 @@ module Oboe
45
45
 
46
46
  class << self
47
47
  def sample?(opts = {})
48
- return false unless Oboe.always?
49
-
50
- # Assure defaults since SWIG enforces Strings
51
- opts[:layer] ||= ''
52
- opts[:xtrace] ||= ''
53
- opts['X-TV-Meta'] ||= ''
54
-
55
- rv = Oboe::Context.sampleRequest(opts[:layer], opts[:xtrace], opts['X-TV-Meta'])
56
-
57
- # For older liboboe that returns true/false, just return that.
58
- return rv if [TrueClass, FalseClass].include?(rv.class) or (rv == 0)
59
-
60
- # liboboe version > 1.3.1 returning a bit masked integer with SampleRate and
61
- # source embedded
62
- Oboe.sample_rate = (rv & SAMPLE_RATE_MASK)
63
- Oboe.sample_source = (rv & SAMPLE_SOURCE_MASK) >> 24
64
-
65
- rv
48
+ begin
49
+ return false unless Oboe.always? && Oboe.loaded
50
+
51
+ # Assure defaults since SWIG enforces Strings
52
+ layer = opts[:layer] ? opts[:layer].strip : ''
53
+ xtrace = opts[:xtrace] ? opts[:xtrace].strip : ''
54
+ tv_meta = opts['X-TV-Meta'] ? opts['X-TV-Meta'].strip : ''
55
+
56
+ rv = Oboe::Context.sampleRequest(layer, xtrace, tv_meta)
57
+
58
+ if rv == 0
59
+ Oboe.sample_rate = -1
60
+ Oboe.sample_source = -1
61
+ false
62
+ else
63
+ # liboboe version > 1.3.1 returning a bit masked integer with SampleRate and
64
+ # source embedded
65
+ Oboe.sample_rate = (rv & SAMPLE_RATE_MASK)
66
+ Oboe.sample_source = (rv & SAMPLE_SOURCE_MASK) >> 24
67
+ true
68
+ end
69
+ rescue StandardError => e
70
+ Oboe.logger.debug "[oboe/error] sample? error: #{e.inspect}"
71
+ false
72
+ end
66
73
  end
67
74
 
68
75
  def set_tracing_mode(mode)
@@ -3,7 +3,7 @@ module OboeHeroku
3
3
  MAJOR = 0
4
4
  MINOR = 9
5
5
  PATCH = 17
6
- BUILD = 4
6
+ BUILD = 8
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
data/lib/oboe-heroku.rb CHANGED
@@ -9,7 +9,7 @@ begin
9
9
 
10
10
  # TRACEVIEW_URL env var is standard with the Heroku addon. We
11
11
  # use it to determine if we are actually running in Heroku or not.
12
- if ENV.key?('TRACEVIEW_URL') and (($0 =~ /rake$/i) == nil)
12
+ if ENV.key?('TRACEVIEW_URL')
13
13
 
14
14
  require 'oboe_metal.so'
15
15
  require 'heroku_metal'
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.6.2"])
23
+ s.add_dependency(%q<oboe>, [">= 2.7.8.1"])
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.17.4
4
+ version: 0.9.17.8
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-12-15 00:00:00.000000000 Z
12
+ date: 2015-01-09 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.6.2
20
+ version: 2.7.8.1
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.6.2
27
+ version: 2.7.8.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement