oboe-heroku 0.9.14.4 → 0.9.15.6

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: 09484b9fe45f61da96ed10ded3e01b791e1ad82f
4
- data.tar.gz: 2324d8eed83cce559361b32ac4d9ca42147e0bd8
3
+ metadata.gz: 77b525534ab23bff7247bc648e85de1e53542e6c
4
+ data.tar.gz: d141e8a197b1cdb1bac0ba87a5303faa3ad3c57e
5
5
  SHA512:
6
- metadata.gz: 040d95a18c76a3b848893d1e98adcc6f1ffba6b173ef982dc9d2b1dd958b3c221aeae1f025c911863729604cb2582a256af4d91b59d705486cc3711bdcc0478d
7
- data.tar.gz: 1bb1087081192a6a8571827ec9963f33a6fb1b54cfafe7230f96677fa77a21e55e09b0e713dd3c1251b9b5ff28b1d75f9ca34685bb6a4e834c7a1ff122215912
6
+ metadata.gz: aa1eabb362855ec18c834b9f191c1c7cb466fb31896bb2007d44a378b8df5296ba64e19e3affaedf53f9c50a30bc1455b203791a489e4a5c1f8e1bd8ed1de135
7
+ data.tar.gz: d44d39fa3854a20d79cdf5a31c2e57b92efa1e965411d17415f6b07d3b35b8320f420eb127d6aad9e85c9e2873f24c8863e13b5ad1e280a60231db503a6a0b17
data/Gemfile CHANGED
@@ -1,14 +1,26 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Import dependencies from oboe-heroku.gemspec
4
- gemspec :name => 'oboe-heroku'
3
+ group :development, :test do
4
+ gem 'minitest'
5
+ gem 'minitest-reporters'
6
+ gem 'rack-test'
7
+ gem 'appraisal'
8
+ end
5
9
 
6
10
  group :development do
7
- gem 'guard'
8
- gem 'guard-rspec'
9
-
10
- gem 'rb-inotify', :require => false
11
- gem 'rb-fsevent', :require => false
12
- gem 'rb-fchange', :require => false
11
+ gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
12
+ gem 'debugger', :platform => :mri_19
13
+ gem 'byebug', :platforms => [ :mri_20, :mri_21 ]
14
+ gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
15
+ if RUBY_VERSION > '1.8.7'
16
+ gem 'pry'
17
+ else
18
+ gem 'pry', '0.9.12.4'
19
+ end
13
20
  end
14
21
 
22
+ gem 'oboe', :path => "~/Projects/oboe-ruby"
23
+
24
+ # Import dependencies from oboe-heroku.gemspec
25
+ gemspec :name => 'oboe-heroku'
26
+
data/Gemfile.lock CHANGED
@@ -1,65 +1,77 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oboe-heroku (0.9.13.1)
5
- oboe (>= 2.6.5.1)
4
+ oboe-heroku (0.9.15.3)
5
+ oboe (>= 2.7.1.6)
6
+
7
+ PATH
8
+ remote: ~/Projects/oboe-ruby
9
+ specs:
10
+ oboe (2.7.1.6)
11
+ json
6
12
 
7
13
  GEM
8
14
  remote: https://rubygems.org/
9
15
  specs:
16
+ ansi (1.4.3)
17
+ appraisal (1.0.2)
18
+ bundler
19
+ rake
20
+ thor (>= 0.14.0)
21
+ builder (3.2.2)
22
+ byebug (3.2.0)
23
+ columnize (~> 0.8)
24
+ debugger-linecache (~> 1.2)
10
25
  coderay (1.0.9)
11
- diff-lcs (1.2.4)
12
- ffi (1.9.0)
13
- formatador (0.2.4)
14
- guard (1.8.2)
15
- formatador (>= 0.2.4)
16
- listen (>= 1.0.0)
17
- lumberjack (>= 1.0.2)
18
- pry (>= 0.9.10)
19
- thor (>= 0.14.6)
20
- guard-rspec (3.0.2)
21
- guard (>= 1.8)
22
- rspec (~> 2.13)
23
- json (0.4.3)
24
- listen (1.3.0)
25
- rb-fsevent (>= 0.9.3)
26
- rb-inotify (>= 0.9)
27
- rb-kqueue (>= 0.2)
28
- lumberjack (1.0.4)
26
+ columnize (0.8.9)
27
+ debugger (1.6.8)
28
+ columnize (>= 0.3.1)
29
+ debugger-linecache (~> 1.2.0)
30
+ debugger-ruby_core_source (~> 1.3.5)
31
+ debugger-linecache (1.2.0)
32
+ debugger-ruby_core_source (1.3.5)
33
+ json (1.8.1)
34
+ linecache (0.46)
35
+ rbx-require-relative (> 0.0.4)
29
36
  method_source (0.8.2)
30
- oboe (2.6.5.1)
31
- json (~> 0.4, >= 0.4.0)
37
+ minitest (5.4.1)
38
+ minitest-reporters (1.0.5)
39
+ ansi
40
+ builder
41
+ minitest (>= 5.0)
42
+ ruby-progressbar
43
+ perftools.rb (2.0.1)
32
44
  pry (0.9.12.2)
33
45
  coderay (~> 1.0.5)
34
46
  method_source (~> 0.8)
35
47
  slop (~> 3.4)
36
- rake (10.1.0)
37
- rb-fchange (0.0.6)
38
- ffi
39
- rb-fsevent (0.9.3)
40
- rb-inotify (0.9.1)
41
- ffi (>= 0.5.0)
42
- rb-kqueue (0.2.0)
43
- ffi (>= 0.5.0)
44
- rspec (2.14.1)
45
- rspec-core (~> 2.14.0)
46
- rspec-expectations (~> 2.14.0)
47
- rspec-mocks (~> 2.14.0)
48
- rspec-core (2.14.5)
49
- rspec-expectations (2.14.2)
50
- diff-lcs (>= 1.1.3, < 2.0)
51
- rspec-mocks (2.14.3)
48
+ rack (1.5.2)
49
+ rack-test (0.6.2)
50
+ rack (>= 1.0)
51
+ rake (10.3.2)
52
+ rbx-require-relative (0.0.9)
53
+ ruby-debug (0.10.4)
54
+ columnize (>= 0.1)
55
+ ruby-debug-base (~> 0.10.4.0)
56
+ ruby-debug-base (0.10.4)
57
+ linecache (>= 0.3)
58
+ ruby-progressbar (1.5.1)
52
59
  slop (3.4.6)
53
- thor (0.18.1)
60
+ thor (0.19.1)
54
61
 
55
62
  PLATFORMS
56
63
  ruby
57
64
 
58
65
  DEPENDENCIES
59
- guard
60
- guard-rspec
66
+ appraisal
67
+ byebug
68
+ debugger
69
+ minitest
70
+ minitest-reporters
71
+ oboe!
61
72
  oboe-heroku!
73
+ perftools.rb
74
+ pry
75
+ rack-test
62
76
  rake
63
- rb-fchange
64
- rb-fsevent
65
- rb-inotify
77
+ ruby-debug
data/Rakefile CHANGED
@@ -1,16 +1,108 @@
1
1
  #!/usr/bin/env rake
2
2
 
3
+ require 'rubygems'
4
+ require 'bundler/setup'
3
5
  require 'rake/testtask'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new('spec')
6
+ require 'appraisal'
7
7
 
8
8
  Rake::TestTask.new do |t|
9
- t.libs << 'spec'
9
+ t.libs << "test"
10
+ t.test_files = FileList['test/**/*_test.rb']
11
+ t.verbose = true
12
+ if defined?(JRUBY_VERSION)
13
+ t.ruby_opts = ["-J-javaagent:/usr/local/tracelytics/tracelyticsagent.jar"]
14
+ end
15
+ end
16
+
17
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
18
+ task :default => :appraisal
19
+ else
20
+ task :default => :test
21
+ end
22
+
23
+ desc "Build the gem's c extension"
24
+ task :compile do
25
+ unless defined?(JRUBY_VERSION)
26
+ puts "== Building the c extension against Ruby #{RUBY_VERSION}"
27
+
28
+ pwd = Dir.pwd
29
+ ext_dir = File.expand_path('ext/oboe_metal')
30
+ lib_dir = File.expand_path('lib')
31
+ symlink = File.expand_path('lib/oboe_metal.so')
32
+ so_file = File.expand_path('ext/oboe_metal/oboe_metal.so')
33
+
34
+ Dir.chdir ext_dir
35
+ cmd = [ Gem.ruby, 'extconf.rb']
36
+ sh cmd.join(' ')
37
+ sh '/usr/bin/env make'
38
+ File.delete symlink if File.exist? symlink
39
+
40
+ if File.exists? so_file
41
+ File.symlink so_file, symlink
42
+ Dir.chdir pwd
43
+ puts "== Extension built and symlink'd to #{symlink}"
44
+ else
45
+ Dir.chdir pwd
46
+ puts "!! Extension failed to build (see above). Are the base TraceView packages installed?"
47
+ puts "!! See https://support.appneta.com/cloud/installing-traceview"
48
+ end
49
+ else
50
+ puts "== Nothing to do under JRuby."
51
+ end
52
+ end
53
+
54
+ desc "Clean up extension build files"
55
+ task :clean do
56
+ unless defined?(JRUBY_VERSION)
57
+ pwd = Dir.pwd
58
+ ext_dir = File.expand_path('ext/oboe_metal')
59
+ lib_dir = File.expand_path('lib')
60
+ symlink = File.expand_path('lib/oboe_metal.so')
61
+ so_file = File.expand_path('ext/oboe_metal/oboe_metal.so')
62
+
63
+ Dir.chdir ext_dir
64
+ sh '/usr/bin/env make clean'
65
+
66
+ Dir.chdir pwd
67
+ else
68
+ puts "== Nothing to do under JRuby."
69
+ end
70
+ end
71
+
72
+ desc "Remove all built files and extensions"
73
+ task :distclean do
74
+ unless defined?(JRUBY_VERSION)
75
+ pwd = Dir.pwd
76
+ ext_dir = File.expand_path('ext/oboe_metal')
77
+ lib_dir = File.expand_path('lib')
78
+ symlink = File.expand_path('lib/oboe_metal.so')
79
+ so_file = File.expand_path('ext/oboe_metal/oboe_metal.so')
80
+ mkmf_log = File.expand_path('ext/oboe_metal/mkmf.log')
81
+
82
+ if File.exists? mkmf_log
83
+ Dir.chdir ext_dir
84
+ File.delete symlink if File.exist? symlink
85
+ sh '/usr/bin/env make distclean'
86
+
87
+ Dir.chdir pwd
88
+ else
89
+ puts "Nothing to distclean. (nothing built yet?)"
90
+ end
91
+ else
92
+ puts "== Nothing to do under JRuby."
93
+ end
94
+ end
95
+
96
+ desc "Rebuild the gem's c extension"
97
+ task :recompile => [ :distclean, :compile ]
98
+
99
+ task :console do
100
+ ENV['TRACEVIEW_URL'] = "http://something"
101
+ ENV['TRACEVIEW_DEBUG_LEVEL'] = "5"
102
+ require 'pry'
103
+ require 'oboe-heroku'
104
+ ARGV.clear
105
+ Pry.start
10
106
  end
11
107
 
12
- desc "Run tests"
13
- task :default => :spec
14
- task :test => :spec
15
108
 
16
- Dir["tasks/**/*.rake"].each { |ext| load ext } if defined?(Rake)
data/lib/heroku_metal.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # Copyright (c) 2013 AppNeta
2
2
  # All rights reserved.
3
3
 
4
- require 'oboe-heroku/base'
5
-
6
4
  module Oboe
7
5
  extend OboeBase
8
6
  include Oboe_metal
@@ -22,32 +22,27 @@ SAMPLE_SOURCE_MASK = 0b1111000000000000000000000000
22
22
  ZERO_SAMPLE_RATE_MASK = 0b1111000000000000000000000000
23
23
  ZERO_SAMPLE_SOURCE_MASK = 0b0000111111111111111111111111
24
24
 
25
- module Oboe_metal
26
- class Context
27
- class << self
28
- attr_accessor :layer_op
29
-
30
- def tracing_layer_op?(operation)
31
- if operation.is_a?(Array)
32
- return operation.include?(@layer_op)
33
- else
34
- return @layer_op == operation
35
- end
36
- end
37
- end
38
- end
39
- end
40
-
41
25
  module OboeBase
26
+ extend ::Oboe::ThreadLocal
27
+
42
28
  attr_accessor :reporter
43
29
  attr_accessor :loaded
44
30
  attr_accessor :sample_source
45
31
  attr_accessor :sample_rate
32
+ thread_local :layer_op
46
33
 
47
34
  def self.included(cls)
48
35
  self.loaded = true
49
36
  end
50
37
 
38
+ def tracing_layer_op?(operation)
39
+ if operation.is_a?(Array)
40
+ return operation.include?(Oboe.layer_op)
41
+ else
42
+ return Oboe.layer_op == operation
43
+ end
44
+ end
45
+
51
46
  def always?
52
47
  Oboe::Config[:tracing_mode].to_s == "always"
53
48
  end
@@ -105,3 +100,7 @@ module OboeBase
105
100
 
106
101
  end
107
102
 
103
+ module Oboe
104
+ extend OboeBase
105
+ end
106
+
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2014 AppNeta, Inc.
2
+ # All rights reserved.
3
+
4
+ module Oboe
5
+ module ThreadLocal
6
+ def thread_local(name)
7
+ key = "__#{self}_#{name}__".intern
8
+
9
+ define_method(name) do
10
+ Thread.current[key]
11
+ end
12
+
13
+ define_method(name.to_s + "=") do |value|
14
+ Thread.current[key] = value
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,8 +2,8 @@ module OboeHeroku
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 9
5
- PATCH = 14
6
- BUILD = 4
5
+ PATCH = 15
6
+ BUILD = 6
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
data/lib/oboe-heroku.rb CHANGED
@@ -5,17 +5,11 @@ begin
5
5
  # TRACEVIEW_URL env var is standard with the Heroku addon. We
6
6
  # use it to determine if we are actually running in Heroku or not.
7
7
  if ENV.has_key?('TRACEVIEW_URL') and ENV['RAILS_GROUP'] != 'assets'
8
- begin
9
- require 'heroku_metal'
10
- require 'oboe_metal.so'
11
- rescue LoadError => e
12
- Oboe.loaded = false
13
-
14
- if ENV.has_key?('TRACEVIEW_DEBUG_LEVEL') and (ENV['TRACEVIEW_DEBUG_LEVEL'].to_i > 1)
15
- $stderr.puts "[oboe-heroku/error] Could not load all dependencies: #{e.message}"
16
- $stderr.puts e.backtrace.join("\n")
17
- end
18
- end
8
+
9
+ require "oboe-heroku/thread_local"
10
+ require 'oboe-heroku/base'
11
+ require 'oboe_metal.so'
12
+ require 'heroku_metal'
19
13
 
20
14
  require 'oboe-heroku/loading'
21
15
  require 'oboe-heroku/version'
@@ -25,10 +19,17 @@ begin
25
19
 
26
20
  ::OboeHeroku::Loading.configure if Oboe.loaded
27
21
  end
22
+ rescue LoadError => e
23
+ Oboe.loaded = false
24
+ $stderr.puts "[oboe-heroku/error] Failed to load support libs: #{e.message}"
25
+
26
+ if ENV.has_key?('TRACEVIEW_DEBUG_LEVEL') and (ENV['TRACEVIEW_DEBUG_LEVEL'].to_i > 1)
27
+ $stderr.puts e.backtrace.join("\n")
28
+ end
28
29
  rescue Exception => e
29
30
  Oboe.loaded = false
31
+ $stderr.puts "[oboe-heroku/error] #{e.message}"
30
32
 
31
- $stderr.puts "[oboe-heroku/error] Problem loading: #{e.message}"
32
33
  if ENV.has_key?('TRACEVIEW_DEBUG_LEVEL') and (ENV['TRACEVIEW_DEBUG_LEVEL'].to_i > 1)
33
34
  $stderr.puts e.backtrace.join("\n")
34
35
  end
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.6.7.1"])
23
+ s.add_dependency(%q<oboe>, [">= 2.7.1.7"])
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.14.4
4
+ version: 0.9.15.6
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-07-23 00:00:00.000000000 Z
12
+ date: 2014-09-08 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.6.7.1
20
+ version: 2.7.1.7
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.6.7.1
27
+ version: 2.7.1.7
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +81,7 @@ files:
81
81
  - lib/oboe-heroku.rb
82
82
  - lib/oboe-heroku/base.rb
83
83
  - lib/oboe-heroku/loading.rb
84
+ - lib/oboe-heroku/thread_local.rb
84
85
  - lib/oboe-heroku/version.rb
85
86
  - oboe-heroku.gemspec
86
87
  - tasks/.keep
@@ -109,3 +110,4 @@ signing_key:
109
110
  specification_version: 4
110
111
  summary: AppNeta TraceView performance instrumentation gem for the Heroku platform
111
112
  test_files: []
113
+ has_rdoc: