oboe 2.2.6 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.gitignore +6 -1
  2. data/Appraisals +20 -0
  3. data/Gemfile +16 -20
  4. data/README.md +280 -10
  5. data/Rakefile +63 -7
  6. data/ext/oboe_metal/extconf.rb +2 -1
  7. data/ext/oboe_metal/tests/test.rb +4 -0
  8. data/gemfiles/rails2.3.gemfile +18 -0
  9. data/gemfiles/rails2.3.gemfile.lock +95 -0
  10. data/gemfiles/rails3.0.gemfile +18 -0
  11. data/gemfiles/rails3.0.gemfile.lock +142 -0
  12. data/gemfiles/rails3.1.gemfile +18 -0
  13. data/gemfiles/rails3.1.gemfile.lock +152 -0
  14. data/gemfiles/rails3.2.gemfile +18 -0
  15. data/gemfiles/rails3.2.gemfile.lock +150 -0
  16. data/init.rb +1 -1
  17. data/lib/joboe_metal.rb +52 -34
  18. data/lib/method_profiling.rb +1 -1
  19. data/lib/oboe.rb +6 -5
  20. data/lib/oboe/api.rb +1 -1
  21. data/lib/oboe/api/layerinit.rb +3 -0
  22. data/lib/oboe/api/logging.rb +1 -1
  23. data/lib/oboe/api/memcache.rb +2 -2
  24. data/lib/oboe/api/profiling.rb +6 -4
  25. data/lib/oboe/api/tracing.rb +1 -1
  26. data/lib/oboe/api/util.rb +1 -1
  27. data/lib/oboe/config.rb +29 -10
  28. data/lib/oboe/frameworks/rails.rb +6 -7
  29. data/lib/oboe/frameworks/rails/inst/action_controller.rb +1 -1
  30. data/lib/oboe/frameworks/rails/inst/action_view.rb +3 -3
  31. data/lib/oboe/frameworks/rails/inst/action_view_2x.rb +3 -3
  32. data/lib/oboe/frameworks/rails/inst/action_view_30.rb +3 -3
  33. data/lib/oboe/frameworks/rails/inst/active_record.rb +1 -1
  34. data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql.rb +1 -1
  35. data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb +1 -1
  36. data/lib/oboe/frameworks/rails/inst/connection_adapters/oracle.rb +1 -1
  37. data/lib/oboe/frameworks/rails/inst/connection_adapters/postgresql.rb +1 -1
  38. data/lib/oboe/frameworks/rails/inst/connection_adapters/utils.rb +2 -2
  39. data/lib/oboe/inst/cassandra.rb +2 -2
  40. data/lib/oboe/inst/dalli.rb +8 -4
  41. data/lib/oboe/inst/http.rb +38 -34
  42. data/lib/oboe/inst/memcache.rb +12 -3
  43. data/lib/oboe/inst/memcached.rb +10 -5
  44. data/lib/oboe/inst/mongo.rb +19 -15
  45. data/lib/oboe/inst/moped.rb +120 -51
  46. data/lib/oboe/inst/rack.rb +14 -7
  47. data/lib/oboe/inst/resque.rb +2 -2
  48. data/lib/oboe/instrumentation.rb +3 -0
  49. data/lib/oboe/loading.rb +2 -6
  50. data/lib/oboe/logger.rb +3 -1
  51. data/lib/oboe/ruby.rb +3 -0
  52. data/lib/oboe/util.rb +2 -0
  53. data/lib/oboe/version.rb +5 -2
  54. data/lib/oboe_fu.rb +2 -0
  55. data/lib/oboe_metal.rb +23 -10
  56. data/lib/rails/generators/oboe/install_generator.rb +5 -3
  57. data/lib/rails/generators/oboe/templates/oboe_initializer.rb +24 -2
  58. data/oboe.gemspec +20 -14
  59. data/test/instrumentation/cassandra_test.rb +331 -0
  60. data/test/instrumentation/dalli_test.rb +157 -0
  61. data/test/instrumentation/http_test.rb +74 -0
  62. data/test/instrumentation/memcache_test.rb +251 -0
  63. data/test/instrumentation/memcached_test.rb +218 -0
  64. data/test/instrumentation/mongo_test.rb +406 -0
  65. data/test/instrumentation/moped_test.rb +468 -0
  66. data/test/instrumentation/rack_test.rb +55 -0
  67. data/test/instrumentation/resque_test.rb +62 -0
  68. data/test/minitest_helper.rb +113 -0
  69. data/test/support/config_test.rb +41 -0
  70. metadata +56 -35
  71. data/Gemfile.lock +0 -103
  72. data/Guardfile +0 -24
  73. data/install.rb +0 -1
  74. data/spec/instrumentation/cassandra_spec.rb +0 -18
  75. data/spec/instrumentation/dalli_spec.rb +0 -14
  76. data/spec/instrumentation/http_spec.rb +0 -14
  77. data/spec/instrumentation/memcache_spec.rb +0 -19
  78. data/spec/instrumentation/memcached_spec.rb +0 -22
  79. data/spec/instrumentation/mongo_spec.rb +0 -29
  80. data/spec/instrumentation/moped_spec.rb +0 -41
  81. data/spec/instrumentation/resque_spec.rb +0 -18
  82. data/spec/spec_helper.rb +0 -15
  83. data/spec/support/config_spec.rb +0 -27
  84. data/spec/support/oboe_spec.rb +0 -4
data/Guardfile DELETED
@@ -1,24 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'rspec' do
5
- watch(%r{^spec/.+_spec\.rb$})
6
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
-
9
- # Rails example
10
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
- watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
- watch('config/routes.rb') { "spec/routing" }
15
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
-
17
- # Capybara features specs
18
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
19
-
20
- # Turnip features and steps
21
- watch(%r{^spec/acceptance/(.+)\.feature$})
22
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
23
- end
24
-
data/install.rb DELETED
@@ -1 +0,0 @@
1
- #Install hooks here
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Inst::Cassandra do
4
- it 'Stock Cassandra should be loaded, defined and ready' do
5
- defined?(::Cassandra).should_not == nil
6
- end
7
-
8
- it 'Cassandra should have oboe methods defined' do
9
- [ :insert, :remove, :count_columns, :get_columns, :multi_get_columns, :get,
10
- :multi_get, :get_range_single, :get_range_batch, :get_indexed_slices,
11
- :create_index, :drop_index, :add_column_family, :drop_column_family,
12
- :add_keyspace, :drop_keyspace ].each do |m|
13
- ::Cassandra.method_defined?("#{m}_with_oboe").should == true
14
- end
15
- # Special 'exists?' case
16
- ::Cassandra.method_defined?("exists_with_oboe?").should == true
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Inst::Dalli do
4
- it 'Stock Dalli should be loaded, defined and ready' do
5
- defined?(::Dalli).should_not == nil
6
- defined?(::Dalli::Client).should_not == nil
7
- end
8
-
9
- it 'Dalli should have oboe methods defined' do
10
- [ :perform_with_oboe, :get_multi_with_oboe ].each do |m|
11
- ::Dalli::Client.method_defined?(m).should == true
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
-
3
-
4
- describe Oboe::Inst do
5
- it 'Net::HTTP should be defined and ready' do
6
- defined?(::Net::HTTP).should_not == nil
7
- end
8
-
9
- it 'Net::HTTP should have oboe methods defined' do
10
- [ :request_with_oboe ].each do |m|
11
- ::Net::HTTP.method_defined?(m).should == true
12
- end
13
- end
14
- end
@@ -1,19 +0,0 @@
1
- require 'spec_helper'
2
- require 'memcache'
3
-
4
- describe Oboe::API::Memcache do
5
- it 'Stock MemCache should be loaded, defined and ready' do
6
- defined?(::MemCache).should_not == nil
7
- end
8
-
9
- it 'MemCache should have oboe methods defined' do
10
- Oboe::API::Memcache::MEMCACHE_OPS.each do |m|
11
- if ::MemCache.method_defined?(m)
12
- ::MemCache.method_defined?("#{m}_with_oboe").should == true
13
- end
14
- ::MemCache.method_defined?(:request_setup_with_oboe).should == true
15
- ::MemCache.method_defined?(:cache_get_with_oboe).should == true
16
- ::MemCache.method_defined?(:get_multi_with_oboe).should == true
17
- end
18
- end
19
- end
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- if (RUBY_VERSION =~ /^1./) == 0
4
- describe Oboe::Inst::Memcached do
5
- require 'memcached'
6
- require 'memcached/rails'
7
-
8
- it 'Stock Memcached should be loaded, defined and ready' do
9
- defined?(::Memcached).should_not == nil
10
- defined?(::Memcached::Rails).should_not == nil
11
- end
12
-
13
- it 'Memcached should have oboe methods defined' do
14
- Oboe::API::Memcache::MEMCACHE_OPS.each do |m|
15
- if ::Memcached.method_defined?(m)
16
- ::Memcached.method_defined?("#{m}_with_oboe").should == true
17
- end
18
- ::Memcached::Rails.method_defined?(:get_multi_with_oboe).should == true
19
- end
20
- end
21
- end
22
- end
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Inst::Mongo do
4
- it 'Stock Mongo should be loaded, defined and ready' do
5
- defined?(::Mongo).should_not == nil
6
- defined?(::Mongo::DB).should_not == nil
7
- defined?(::Mongo::Cursor).should_not == nil
8
- defined?(::Mongo::Collection).should_not == nil
9
- end
10
-
11
- it 'Mongo should have oboe methods defined' do
12
- Oboe::Inst::Mongo::DB_OPS.each do |m|
13
- ::Mongo::DB.method_defined?("#{m}_with_oboe").should == true
14
- end
15
- Oboe::Inst::Mongo::CURSOR_OPS.each do |m|
16
- ::Mongo::Cursor.method_defined?("#{m}_with_oboe").should == true
17
- end
18
- Oboe::Inst::Mongo::COLL_WRITE_OPS.each do |m|
19
- ::Mongo::Collection.method_defined?("#{m}_with_oboe").should == true
20
- end
21
- Oboe::Inst::Mongo::COLL_QUERY_OPS.each do |m|
22
- ::Mongo::Collection.method_defined?("#{m}_with_oboe").should == true
23
- end
24
- Oboe::Inst::Mongo::COLL_INDEX_OPS.each do |m|
25
- ::Mongo::Collection.method_defined?("#{m}_with_oboe").should == true
26
- end
27
- ::Mongo::Collection.method_defined?(:oboe_collect).should == true
28
- end
29
- end
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Inst::Moped do
4
- it 'Stock Moped should be loaded, defined and ready' do
5
- defined?(::Moped).should_not == nil
6
- defined?(::Moped::Database).should_not == nil
7
- defined?(::Moped::Indexes).should_not == nil
8
- defined?(::Moped::Query).should_not == nil
9
- defined?(::Moped::Collection).should_not == nil
10
- end
11
-
12
- it 'Moped should have oboe methods defined' do
13
- #::Moped::Database
14
- Oboe::Inst::Moped::DB_OPS.each do |m|
15
- ::Moped::Database.method_defined?("#{m}_with_oboe").should == true
16
- end
17
- ::Moped::Database.method_defined?(:extract_trace_details).should == true
18
- ::Moped::Database.method_defined?(:command_with_oboe).should == true
19
- ::Moped::Database.method_defined?(:drop_with_oboe).should == true
20
-
21
- #::Moped::Indexes
22
- Oboe::Inst::Moped::INDEX_OPS.each do |m|
23
- ::Moped::Indexes.method_defined?("#{m}_with_oboe").should == true
24
- end
25
- ::Moped::Indexes.method_defined?(:extract_trace_details).should == true
26
- ::Moped::Indexes.method_defined?(:create_with_oboe).should == true
27
- ::Moped::Indexes.method_defined?(:drop_with_oboe).should == true
28
-
29
- #::Moped::Query
30
- Oboe::Inst::Moped::QUERY_OPS.each do |m|
31
- ::Moped::Query.method_defined?("#{m}_with_oboe").should == true
32
- end
33
- ::Moped::Query.method_defined?(:extract_trace_details).should == true
34
-
35
- #::Moped::Collection
36
- Oboe::Inst::Moped::COLLECTION_OPS.each do |m|
37
- ::Moped::Collection.method_defined?("#{m}_with_oboe").should == true
38
- end
39
- ::Moped::Collection.method_defined?(:extract_trace_details).should == true
40
- end
41
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Inst::Resque do
4
- it 'Stock Resque should be loaded, defined and ready' do
5
- defined?(::Resque).should_not == nil
6
- defined?(::Resque::Worker).should_not == nil
7
- defined?(::Resque::Job).should_not == nil
8
- end
9
-
10
- it 'Resque should have oboe methods defined' do
11
- [ :enqueue, :enqueue_to, :dequeue ].each do |m|
12
- ::Resque.method_defined?("#{m}_with_oboe").should == true
13
- end
14
-
15
- ::Resque::Worker.method_defined?("perform_with_oboe").should == true
16
- ::Resque::Job.method_defined?("fail_with_oboe").should == true
17
- end
18
- end
@@ -1,15 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- Bundler.require(:default, :test)
5
-
6
- RSpec.configure do |config|
7
- config.color_enabled = true
8
- config.formatter = 'documentation'
9
- end
10
-
11
- # Preload memcache-client
12
- require 'memcache'
13
-
14
- Oboe::Ruby.initialize
15
-
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe::Config do
4
-
5
- it 'should have the correct default values' do
6
- Oboe::Config[:verbose].should == false
7
- Oboe::Config[:sample_rate].should == 1000000
8
- Oboe::Config[:tracing_mode].should == "through"
9
- Oboe::Config[:reporter_host].should == "127.0.0.1"
10
- end
11
-
12
- it 'should have the correct instrumentation defaults' do
13
-
14
- instrumentation = [ :cassandra, :dalli, :nethttp, :memcached, :memcache, :mongo,
15
- :moped, :rack, :resque, :action_controller, :action_view,
16
- :active_record ]
17
-
18
- # Verify the number of individual instrumentations
19
- instrumentation.count.should == 12
20
-
21
- instrumentation.each do |k|
22
- Oboe::Config[k][:enabled].should == true
23
- Oboe::Config[k][:log_args].should == true
24
- end
25
- end
26
-
27
- end
@@ -1,4 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Oboe do
4
- end