xray 1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. data/README +65 -0
  2. data/bin/install_dtrace_on_ubuntu +30 -0
  3. data/bin/xray_profile_ruby_function_calls.d +54 -0
  4. data/bin/xray_top_10_busiest_code_path_for_process.d +12 -0
  5. data/bin/xray_top_10_busiest_code_path_on_system.d +35 -0
  6. data/bin/xray_trace_all_custom_ruby_probes.d +25 -0
  7. data/bin/xray_trace_all_ruby_probes.d +20 -0
  8. data/bin/xray_trace_memcached.d +20 -0
  9. data/bin/xray_trace_mysql.d +30 -0
  10. data/bin/xray_trace_rails_response_times.d +114 -0
  11. data/lib/xray.rb +2 -0
  12. data/lib/xray/dtrace/rails/action_controller_tracing_extension.rb +22 -0
  13. data/lib/xray/dtrace/rails/active_record_connection_tracing_extension.rb +15 -0
  14. data/lib/xray/dtrace/rails/enable_tracing.rb +25 -0
  15. data/lib/xray/dtrace/tracer.rb +86 -0
  16. data/lib/xray/dtrace/tracer/joyent.rb +25 -0
  17. data/lib/xray/dtrace/tracer/leopard.rb +28 -0
  18. data/lib/xray/dtrace/usdt/provider_extensions.rb +45 -0
  19. data/lib/xray/thread_dump_signal_handler.rb +31 -0
  20. data/patches_for_mri/caller_for_all_threads_patch_for_MRI_1.8.6.diff +229 -0
  21. data/patches_for_mri/caller_for_all_threads_patch_for_MRI_1.8.7.diff +229 -0
  22. data/patches_for_mri/patch-for-dtrace-instrumentation-of-matz-1.8.6-p114.diff +522 -0
  23. data/patches_for_mri/patch-for-joyent-mri-1.8.6-on-mac-os-x-leopard.diff +20645 -0
  24. data/rails/init.rb +2 -0
  25. data/test/all_tests.rb +1 -0
  26. data/test/functional/dtrace/tracer_test.rb +54 -0
  27. data/test/functional/tracer_script.rb +18 -0
  28. data/test/test_helper.rb +9 -0
  29. data/test/unit/xray/dtrace/tracer_test.rb +54 -0
  30. metadata +84 -0
@@ -0,0 +1,2 @@
1
+ require File.dirname(__FILE__) + '/../lib/xray'
2
+ require File.dirname(__FILE__) + '/../lib/xray/dtrace/rails/enable_tracing'
@@ -0,0 +1 @@
1
+ Dir["#{File.dirname __FILE__}/**/*_test.rb"].each { |test_case| require test_case }
@@ -0,0 +1,54 @@
1
+ require File.expand_path(__FILE__ + '/../../../test_helper')
2
+
3
+ functional_tests do
4
+
5
+ test "fire a probe with no data and no block" do
6
+ aClass = Class.new do
7
+ include XRay::DTrace::Tracer
8
+ end
9
+
10
+ aClass.new.fire "a name"
11
+ end
12
+
13
+ test "fire a probe with data and no block" do
14
+ aClass = Class.new do
15
+ include XRay::DTrace::Tracer
16
+ end
17
+
18
+ aClass.new.fire "a name", "some data"
19
+ end
20
+
21
+ test "Can check whether ruby-probe is enabled" do
22
+ aClass = Class.new do
23
+ include XRay::DTrace::Tracer
24
+ end
25
+
26
+ assert [true, false].include?(aClass.new.enabled?)
27
+ end
28
+
29
+ test "fire a probe with block and no data" do
30
+ anObject = Class.new do
31
+ include XRay::DTrace::Tracer
32
+ end.new
33
+
34
+ result = anObject.firing("a-name") do
35
+ :expected_result
36
+ end
37
+
38
+ assert_equal :expected_result, result
39
+ end
40
+
41
+ test "fire a probe with block and data" do
42
+ anObject = Class.new do
43
+ include XRay::DTrace::Tracer
44
+ end.new
45
+
46
+ result = anObject.firing("a-name", "some data") do
47
+ :expected_result
48
+ end
49
+
50
+ assert_equal :expected_result, result
51
+ end
52
+
53
+ end
54
+
@@ -0,0 +1,18 @@
1
+ $: << File.dirname(__FILE__) + '/../../lib'
2
+ require 'xray/dtrace/tracer'
3
+
4
+ class Service
5
+ include XRay::DTrace::Tracer
6
+
7
+ def process
8
+ puts "Processing new request"
9
+ firing "my-service", "a sql query" do
10
+ sleep 2
11
+ end
12
+ end
13
+
14
+ end
15
+
16
+ loop do
17
+ Service.new.process
18
+ end
@@ -0,0 +1,9 @@
1
+ $: << File.dirname(__FILE__) + '/../ext/xray'
2
+ $: << File.dirname(__FILE__) + '/../lib'
3
+ require 'xray'
4
+
5
+ require 'test/unit'
6
+ require 'rubygems'
7
+ require 'mocha'
8
+ require 'dust'
9
+
@@ -0,0 +1,54 @@
1
+ require File.expand_path(__FILE__ + '/../../../../test_helper')
2
+
3
+ unit_tests do
4
+
5
+ test "fire a probe with no data and no block" do
6
+ aClass = Class.new do
7
+ include XRay::DTrace::Tracer
8
+ end
9
+
10
+ aClass.new.fire "a name"
11
+ end
12
+
13
+ test "fire a probe with data and no block" do
14
+ aClass = Class.new do
15
+ include XRay::DTrace::Tracer
16
+ end
17
+
18
+ aClass.new.fire "a name", "some data"
19
+ end
20
+
21
+ test "Can check whether ruby-probe is enabled" do
22
+ aClass = Class.new do
23
+ include XRay::DTrace::Tracer
24
+ end
25
+
26
+ assert [true, false].include?(aClass.new.enabled?)
27
+ end
28
+
29
+ test "fire a probe with block and no data" do
30
+ anObject = Class.new do
31
+ include XRay::DTrace::Tracer
32
+ end.new
33
+
34
+ result = anObject.firing("a-name") do
35
+ :expected_result
36
+ end
37
+
38
+ assert_equal :expected_result, result
39
+ end
40
+
41
+ test "fire a probe with block and data" do
42
+ anObject = Class.new do
43
+ include XRay::DTrace::Tracer
44
+ end.new
45
+
46
+ result = anObject.firing("a-name", "some data") do
47
+ :expected_result
48
+ end
49
+
50
+ assert_equal :expected_result, result
51
+ end
52
+
53
+ end
54
+
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xray
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.1"
5
+ platform: ruby
6
+ authors:
7
+ - Philippe Hanrigou
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-17 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: xray-developer@rubyforge.org
18
+ executables:
19
+ - install_dtrace_on_ubuntu
20
+ - xray_profile_ruby_function_calls.d
21
+ - xray_top_10_busiest_code_path_for_process.d
22
+ - xray_top_10_busiest_code_path_on_system.d
23
+ - xray_trace_all_custom_ruby_probes.d
24
+ - xray_trace_all_ruby_probes.d
25
+ - xray_trace_memcached.d
26
+ - xray_trace_mysql.d
27
+ - xray_trace_rails_response_times.d
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README
32
+ files:
33
+ - lib/xray/dtrace/rails/action_controller_tracing_extension.rb
34
+ - lib/xray/dtrace/rails/active_record_connection_tracing_extension.rb
35
+ - lib/xray/dtrace/rails/enable_tracing.rb
36
+ - lib/xray/dtrace/tracer/joyent.rb
37
+ - lib/xray/dtrace/tracer/leopard.rb
38
+ - lib/xray/dtrace/tracer.rb
39
+ - lib/xray/dtrace/usdt/provider_extensions.rb
40
+ - lib/xray/thread_dump_signal_handler.rb
41
+ - lib/xray.rb
42
+ - test/all_tests.rb
43
+ - test/functional/dtrace/tracer_test.rb
44
+ - test/functional/tracer_script.rb
45
+ - test/test_helper.rb
46
+ - test/unit/xray/dtrace/tracer_test.rb
47
+ - patches_for_mri/caller_for_all_threads_patch_for_MRI_1.8.6.diff
48
+ - patches_for_mri/caller_for_all_threads_patch_for_MRI_1.8.7.diff
49
+ - patches_for_mri/patch-for-dtrace-instrumentation-of-matz-1.8.6-p114.diff
50
+ - patches_for_mri/patch-for-joyent-mri-1.8.6-on-mac-os-x-leopard.diff
51
+ - rails/init.rb
52
+ - README
53
+ has_rdoc: true
54
+ homepage: http://xray.rubyforge.com
55
+ post_install_message:
56
+ rdoc_options:
57
+ - --title
58
+ - XRay
59
+ - --main
60
+ - README
61
+ - --line-numbers
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: "0"
75
+ version:
76
+ requirements: []
77
+
78
+ rubyforge_project: xray
79
+ rubygems_version: 1.2.0
80
+ signing_key:
81
+ specification_version: 2
82
+ summary: Dump backtrace for all threads.
83
+ test_files:
84
+ - test/all_tests.rb