rubyrun 0.9.0 → 0.9.5
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.
- data/README +50 -50
- data/bin/Rakefile +11 -0
- data/docs/{rubyrun-0.9.0.htm → rubyrun-0.9.5.htm} +2262 -2669
- data/docs/{rubyrun-0.9.0.pdf → rubyrun-0.9.5.pdf} +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/colorschememapping.xml +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/filelist.xml +1 -1
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/header.htm +10 -13
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image001.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image002.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image003.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image004.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image005.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image006.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image007.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image008.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image009.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image010.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image011.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image012.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image013.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image014.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image015.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image016.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image017.png +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image018.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image019.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image020.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image021.jpg +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/image022.png +0 -0
- data/docs/{rubyrun-0.9.0_files → rubyrun-0.9.5_files}/themedata.thmx +0 -0
- data/ext/extconf.rb +2 -1
- data/ext/{rubyrunnative__.bundle → rubyrunnative__ppc-darwin.bundle} +0 -0
- data/ext/{rubyrunnative__i386.bundle → rubyrunnative__x86-darwin.bundle} +0 -0
- data/ext/{rubyrunnative__linux.so → rubyrunnative__x86-linux.so} +0 -0
- data/ext/{rubyrunnative__.so → rubyrunnative__x86-mswin32.so} +0 -0
- data/lib/rubyrun/rubyrun.rb +2 -78
- data/lib/rubyrun/rubyrun_boot__.rb +79 -0
- data/lib/rubyrun/rubyrun_commander__.rb +6 -6
- data/lib/rubyrun/rubyrun_globals.rb +2 -1
- data/lib/rubyrun/rubyrun_initializer__.rb +34 -7
- data/lib/rubyrun/rubyrun_instrumentor__.rb +3 -3
- data/lib/rubyrun/rubyrun_monitor__.rb +2 -1
- data/lib/rubyrun/rubyrun_utils__.rb +7 -4
- metadata +48 -45
- data/Rakefile +0 -274
- data/bin/confgure +0 -2
- data/lib/rubyrunm.rb +0 -10
Binary file
|
File without changes
|
@@ -10,19 +10,15 @@ xmlns="http://www.w3.org/TR/REC-html40">
|
|
10
10
|
<meta name=ProgId content=Word.Document>
|
11
11
|
<meta name=Generator content="Microsoft Word 12">
|
12
12
|
<meta name=Originator content="Microsoft Word 12">
|
13
|
-
<link id=Main-File rel=Main-File href="../
|
13
|
+
<link id=Main-File rel=Main-File href="../rubyrun_ce-0.9.5.htm">
|
14
|
+
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
15
|
+
name="stockticker"/>
|
14
16
|
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
15
17
|
name="place"/>
|
16
18
|
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
17
19
|
name="PlaceName"/>
|
18
20
|
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
19
21
|
name="PlaceType"/>
|
20
|
-
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
21
|
-
name="time"/>
|
22
|
-
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
23
|
-
name="date"/>
|
24
|
-
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
25
|
-
name="stockticker"/>
|
26
22
|
</head>
|
27
23
|
|
28
24
|
<body lang=EN-US link=blue vlink=purple>
|
@@ -109,15 +105,16 @@ style='mso-bidi-font-weight:normal'><!--[if gte vml 1]><v:shapetype id="_x0000_t
|
|
109
105
|
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><span
|
110
106
|
style='mso-tab-count:1'>������������������������������������������������� </span></span>Installation
|
111
107
|
and User Guide<span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><span
|
112
|
-
style='mso-tab-count:1'
|
108
|
+
style='mso-tab-count:1'>��������������������������� </span></span>Page <!--[if supportFields]><span
|
113
109
|
style='mso-element:field-begin'></span><span
|
114
110
|
style='mso-spacerun:yes'>�</span>PAGE <span style='mso-element:field-separator'></span><![endif]--><span
|
115
|
-
style='mso-no-proof:yes'>
|
116
|
-
field-end'></span><![endif]--> of <!--[if supportFields]><span
|
111
|
+
style='mso-no-proof:yes'>32</span><!--[if supportFields]><span
|
112
|
+
style='mso-element:field-end'></span><![endif]--> of <!--[if supportFields]><span
|
117
113
|
style='mso-element:field-begin'></span><span
|
118
114
|
style='mso-spacerun:yes'>�</span>NUMPAGES <span style='mso-element:field-separator'></span><![endif]--><span
|
119
|
-
style='mso-no-proof:yes'>
|
120
|
-
field-end'></span><![endif]--><b style='mso-bidi-font-weight:
|
115
|
+
style='mso-no-proof:yes'>32</span><!--[if supportFields]><span
|
116
|
+
style='mso-element:field-end'></span><![endif]--><b style='mso-bidi-font-weight:
|
117
|
+
normal'><o:p></o:p></b></p>
|
121
118
|
|
122
119
|
</div>
|
123
120
|
|
@@ -129,7 +126,7 @@ style='mso-bidi-font-weight:normal'><!--[if gte vml 1]><v:shape id="_x0000_i1040
|
|
129
126
|
<v:imagedata src="image022.png" o:title="rubysophic_logo"/>
|
130
127
|
</v:shape><![endif]--><span style='mso-tab-count:2'>������������������������������������������������������������������ </span></b><span
|
131
128
|
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Ruby<i
|
132
|
-
style='mso-bidi-font-style:normal'>Run</i><sup>CE</sup> 0.9 Installation and
|
129
|
+
style='mso-bidi-font-style:normal'>Run</i><sup>CE</sup> 0.9.5 Installation and
|
133
130
|
User Guide<o:p></o:p></span></p>
|
134
131
|
|
135
132
|
<p class=MsoHeader><o:p> </o:p></p>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/ext/extconf.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rubyrun/rubyrun.rb
CHANGED
@@ -1,78 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# (C) Copyright Rubysophic Inc. 2007-2008 #
|
4
|
-
# All rights reserved. #
|
5
|
-
# #
|
6
|
-
# Use, duplication or disclosure of the code is not permitted #
|
7
|
-
# unless licensed. #
|
8
|
-
# #
|
9
|
-
# Last Updated: 7/09/08 #
|
10
|
-
#---------------------------------------------------------------#
|
11
|
-
# #
|
12
|
-
# RubyRun bootstrap code. #
|
13
|
-
# #
|
14
|
-
# To invoke RubyRun for Rails or a Ruby script, use command #
|
15
|
-
# line option -r. #
|
16
|
-
# #
|
17
|
-
# ruby -rrubyrun script/server <webrick> #
|
18
|
-
# #
|
19
|
-
# To remove RubyRun, simply remove the -r option. #
|
20
|
-
# #
|
21
|
-
# Generally no other code change is needed to run RubyRun. #
|
22
|
-
# #
|
23
|
-
#---------------------------------------------------------------#
|
24
|
-
|
25
|
-
# BEGIN section of the code is always executed first.
|
26
|
-
# 1. Intiialize globals, requires and includes
|
27
|
-
# 2. Intitialize RubyRun runtime environment
|
28
|
-
# Note. For $rubyrun_current_buffer, 1 - primary, 2 - secondary
|
29
|
-
BEGIN {
|
30
|
-
require 'rubyrun_globals'
|
31
|
-
require 'rubyrun_instrumentor__'
|
32
|
-
require 'rubyrun_monitor__'
|
33
|
-
require 'rubyrun_initializer__'
|
34
|
-
include RubyRunGlobals
|
35
|
-
include RubyRunInitializer__
|
36
|
-
include RubyRunInstrumentor__
|
37
|
-
include RubyRunMonitor__
|
38
|
-
$rubyrun_include_hash = {}
|
39
|
-
$rubyrun_exclude_hash = {}
|
40
|
-
$rubyrun_thread_stack = {}
|
41
|
-
$rubyrun_metrics_hash = {}
|
42
|
-
$rubyrun_thread_local = {}
|
43
|
-
$rubyrun_file_date_hash = {}
|
44
|
-
$rubyrun_prime_buffer = []
|
45
|
-
$rubyrun_alt_buffer = []
|
46
|
-
$rubyrun_controller_classes = []
|
47
|
-
$rubyrun_current_buffer = 1
|
48
|
-
$rubyrun_lock = Monitor.new
|
49
|
-
init_rubyrun
|
50
|
-
}
|
51
|
-
|
52
|
-
# RubyRun uses 2 traps to get control from the interpreter
|
53
|
-
# to decide if a method should be instrumented or passed
|
54
|
-
#
|
55
|
-
# 1. When an instance method is added when a module/class is
|
56
|
-
# loaded, or dynamically created
|
57
|
-
# 2. When a module/static/singleton method is added when a
|
58
|
-
# module/class is loaded, or dynamically created
|
59
|
-
class Module
|
60
|
-
# module/class instance method trap
|
61
|
-
def method_added(id, *args)
|
62
|
-
RubyRunInstrumentor__.instrument_it?('i', self, id)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class Object
|
67
|
-
# class object/object singleton method trap
|
68
|
-
def singleton_method_added(id, *args)
|
69
|
-
RubyRunInstrumentor__.instrument_it?('s', self, id)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# 1. Instrument Thread.new method to provide a begin/rescue clause
|
74
|
-
# to catch failure for providing a stack trace
|
75
|
-
#
|
76
|
-
# 2. Start the monitor timer thread
|
77
|
-
instrument_thread_new
|
78
|
-
start_thread_monitor
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubyrun_boot__'
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#---------------------------------------------------------------#
|
2
|
+
# #
|
3
|
+
# (C) Copyright Rubysophic Inc. 2007-2008 #
|
4
|
+
# All rights reserved. #
|
5
|
+
# #
|
6
|
+
# Use, duplication or disclosure of the code is not permitted #
|
7
|
+
# unless licensed. #
|
8
|
+
# #
|
9
|
+
# Last Updated: 7/09/08 #
|
10
|
+
#---------------------------------------------------------------#
|
11
|
+
# #
|
12
|
+
# RubyRun bootstrap code. #
|
13
|
+
# #
|
14
|
+
# To invoke RubyRun for Rails or a Ruby script, use command #
|
15
|
+
# line option -r. #
|
16
|
+
# #
|
17
|
+
# ruby -rrubyrun script/server <webrick> #
|
18
|
+
# #
|
19
|
+
# To remove RubyRun, simply remove the -r option. #
|
20
|
+
# #
|
21
|
+
# Generally no other code change is needed to run RubyRun. #
|
22
|
+
# #
|
23
|
+
#---------------------------------------------------------------#
|
24
|
+
|
25
|
+
# BEGIN section of the code is always executed first.
|
26
|
+
# 1. Intiialize globals, requires and includes
|
27
|
+
# 2. Intitialize RubyRun runtime environment
|
28
|
+
# Note. For $rubyrun_current_buffer, 1 - primary, 2 - secondary
|
29
|
+
BEGIN {
|
30
|
+
require 'rubyrun_globals'
|
31
|
+
require 'rubyrun_instrumentor__'
|
32
|
+
require 'rubyrun_monitor__'
|
33
|
+
require 'rubyrun_initializer__'
|
34
|
+
include RubyRunGlobals
|
35
|
+
include RubyRunInitializer__
|
36
|
+
include RubyRunInstrumentor__
|
37
|
+
include RubyRunMonitor__
|
38
|
+
$rubyrun_include_hash = {}
|
39
|
+
$rubyrun_exclude_hash = {}
|
40
|
+
$rubyrun_thread_stack = {}
|
41
|
+
$rubyrun_metrics_hash = {}
|
42
|
+
$rubyrun_thread_local = {}
|
43
|
+
$rubyrun_file_date_hash = {}
|
44
|
+
$rubyrun_prime_buffer = []
|
45
|
+
$rubyrun_alt_buffer = []
|
46
|
+
$rubyrun_controller_classes = []
|
47
|
+
$rubyrun_current_buffer = 1
|
48
|
+
$rubyrun_lock = Monitor.new
|
49
|
+
init_rubyrun
|
50
|
+
}
|
51
|
+
|
52
|
+
# RubyRun uses 2 traps to get control from the interpreter
|
53
|
+
# to decide if a method should be instrumented or passed
|
54
|
+
#
|
55
|
+
# 1. When an instance method is added when a module/class is
|
56
|
+
# loaded, or dynamically created
|
57
|
+
# 2. When a module/static/singleton method is added when a
|
58
|
+
# module/class is loaded, or dynamically created
|
59
|
+
class Module
|
60
|
+
# module/class instance method trap
|
61
|
+
def method_added(id, *args)
|
62
|
+
RubyRunInstrumentor__.instrument_it?('i', self, id)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class Object
|
67
|
+
# class object/object singleton method trap
|
68
|
+
def singleton_method_added(id, *args)
|
69
|
+
RubyRunInstrumentor__.instrument_it?('s', self, id)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# 1. Instrument Thread.new method to provide a begin/rescue clause
|
74
|
+
# to catch failure for providing a stack trace
|
75
|
+
#
|
76
|
+
# 2. Start the monitor timer thread
|
77
|
+
instrument_thread_new
|
78
|
+
start_thread_monitor
|
79
|
+
puts '*** RubyRun successfully started. ***'
|
@@ -154,7 +154,7 @@ module RubyRunCommander__
|
|
154
154
|
# Remove the cmd_kill-3 folder or file if any
|
155
155
|
def remove_cmd_folder
|
156
156
|
[RUBYRUN_CMD_SOFT_KILL, RUBYRUN_CMD_HARD_KILL].each { |cmd|
|
157
|
-
path =
|
157
|
+
path = $rubyrun_working_dir + cmd + '_' + Process.pid.to_s
|
158
158
|
next unless File.exist?(path)
|
159
159
|
File.directory?(path) ? Dir.delete(path) : File.delete(path)
|
160
160
|
}
|
@@ -163,29 +163,29 @@ module RubyRunCommander__
|
|
163
163
|
# If exists, indicate to the monitor thread that a thread
|
164
164
|
# status report is requested
|
165
165
|
def thread_status?
|
166
|
-
File.exists?(
|
166
|
+
File.exists?($rubyrun_working_dir + RUBYRUN_CMD_STATUS)
|
167
167
|
end
|
168
168
|
|
169
169
|
# If exists, indicate to the monitor thread that a soft kill
|
170
170
|
# (kill all threads except the main thread) command is sent
|
171
171
|
def soft_kill?
|
172
|
-
File.exists?(
|
172
|
+
File.exists?($rubyrun_working_dir + RUBYRUN_CMD_SOFT_KILL + '_' + Process.pid.to_s)
|
173
173
|
end
|
174
174
|
|
175
175
|
# If exists, indicate to the monitor thread that a hard kill
|
176
176
|
# (kill all threads including the main thread) command is sent
|
177
177
|
def hard_kill?
|
178
|
-
File.exists?(
|
178
|
+
File.exists?($rubyrun_working_dir + RUBYRUN_CMD_HARD_KILL + '_' + Process.pid.to_s)
|
179
179
|
end
|
180
180
|
|
181
181
|
# If exists, indicate to the montior thread that a object map is requested
|
182
182
|
def object_map?
|
183
|
-
File.exists?(
|
183
|
+
File.exists?($rubyrun_working_dir + RUBYRUN_CMD_OBJECT_MAP)
|
184
184
|
end
|
185
185
|
|
186
186
|
# If exists, indicate to the monitor thread to exit
|
187
187
|
def exit_monitor?
|
188
|
-
File.exists?(
|
188
|
+
File.exists?($rubyrun_working_dir + RUBYRUN_CMD_EXIT)
|
189
189
|
end
|
190
190
|
|
191
191
|
# Log if native library can't be loaded or not found
|
@@ -20,7 +20,8 @@ module RubyRunGlobals
|
|
20
20
|
RUBYRUN_FIREWALL_HASH = {"Gem" => [], "gem" => [], "FileUtils::Verbose" => [], "FileUtils" => [],
|
21
21
|
"Module" => [], "Object" => [], "Time" => [], "Logger" => [], "Thread" => [],
|
22
22
|
"*" => ['method_added', 'initialize', 'singleton_method_added', 'send', 'caller']}
|
23
|
-
|
23
|
+
RUBYRUN_WORKING_DIR_NAME = 'rubyrun'
|
24
|
+
RUBYRUN_ETC_DIR = 'etc'
|
24
25
|
RUBYRUN_LOG = '/log'
|
25
26
|
RUBYRUN_REPORT = '/report'
|
26
27
|
RUBYRUN_SIGNATURE = '/signatures'
|
@@ -22,8 +22,10 @@ module RubyRunInitializer__
|
|
22
22
|
require 'logger'
|
23
23
|
require 'yaml'
|
24
24
|
require 'digest/md5'
|
25
|
+
require 'ftools'
|
25
26
|
require 'rubyrun_globals'
|
26
27
|
require 'rubyrun_utils__'
|
28
|
+
|
27
29
|
include RubyRunGlobals
|
28
30
|
include RubyRunUtils__
|
29
31
|
|
@@ -44,24 +46,49 @@ module RubyRunInitializer__
|
|
44
46
|
# 5. Spawn a separate thread to for monitoring and commands
|
45
47
|
def ready_rubyrun_env
|
46
48
|
begin
|
47
|
-
|
48
|
-
|
49
|
-
rubyrun_working_dir
|
50
|
-
raise RuntimeError, "Missing #{RUBYRUN_OPTS_FILE} in #{rubyrun_working_dir}", caller \
|
51
|
-
unless File.exists?(rubyrun_working_dir + RUBYRUN_OPTS_FILE)
|
49
|
+
$rubyrun_working_dir = Dir.getwd + '/' + RUBYRUN_WORKING_DIR_NAME
|
50
|
+
create_working_dir($rubyrun_working_dir) unless File.exists?($rubyrun_working_dir)
|
51
|
+
create_options_file($rubyrun_working_dir) unless File.exists?($rubyrun_working_dir + RUBYRUN_OPTS_FILE)
|
52
52
|
rescue Exception => e
|
53
53
|
fatal_exit(e)
|
54
54
|
end
|
55
|
-
*rubyrun_folders = rubyrun_working_dir + RUBYRUN_LOG, rubyrun_working_dir + RUBYRUN_REPORT, rubyrun_working_dir + RUBYRUN_SIGNATURE
|
55
|
+
*rubyrun_folders = $rubyrun_working_dir + RUBYRUN_LOG, $rubyrun_working_dir + RUBYRUN_REPORT, $rubyrun_working_dir + RUBYRUN_SIGNATURE
|
56
56
|
make_folder(rubyrun_folders)
|
57
57
|
@rubyrun_log_folder, @rubyrun_report_folder, @rubyrun_signature_folder = *rubyrun_folders
|
58
58
|
logname = File.basename($0, ".*")
|
59
59
|
ready_logfile(logname)
|
60
|
-
system_wide_opts = rubyrun_working_dir + RUBYRUN_OPTS_FILE
|
60
|
+
system_wide_opts = $rubyrun_working_dir + RUBYRUN_OPTS_FILE
|
61
61
|
app_wide_opts = Dir.getwd + '/' + RUBYRUN_OPTS_FILE
|
62
62
|
File.exists?(app_wide_opts) ? load_config_props(app_wide_opts) : load_config_props(system_wide_opts)
|
63
63
|
$rubyrun_tracer = RubyRunHTMLWriter.new(@rubyrun_report_folder + '/' + logname + '_' + $$.to_s + '_trace.html', METHOD_TRACE_HEADER, shift_age = 10, shift_size = 4096000) unless $rubyrun_trace_hash.empty?
|
64
64
|
end
|
65
|
+
|
66
|
+
# Create the working directory, which will be 'rubyrun' under the current directory
|
67
|
+
def create_working_dir(path)
|
68
|
+
begin
|
69
|
+
Dir.mkdir(path)
|
70
|
+
rescue Exception => e
|
71
|
+
raise RuntimeError, "Unable to create working directory #{path}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Create the options file
|
76
|
+
def create_options_file(path)
|
77
|
+
begin
|
78
|
+
yml_source = __FILE__.gsub('\\','/').split('/')[0..-4].join('/') + '/' + RUBYRUN_ETC_DIR + RUBYRUN_OPTS_FILE
|
79
|
+
opts_file = File.new(path + RUBYRUN_OPTS_FILE, "w")
|
80
|
+
File.open(yml_source).each { |line|
|
81
|
+
if line.include?('APP_PATHS: []')
|
82
|
+
File.exists?("#{Dir.getwd+'/app/controllers'}") ? opts_file.puts("APP_PATHS: ['#{Dir.getwd+'/app/controllers'}']") : opts_file.puts("APP_PATHS: ['#{Dir.getwd}']")
|
83
|
+
else
|
84
|
+
opts_file.puts(line)
|
85
|
+
end
|
86
|
+
}
|
87
|
+
opts_file.close
|
88
|
+
rescue Exception => e
|
89
|
+
raise RuntimeError, "Unable to create options file in #{path}"
|
90
|
+
end
|
91
|
+
end
|
65
92
|
|
66
93
|
# Make sub-directories (folders)
|
67
94
|
def make_folder(rubyrun_folders)
|
@@ -111,7 +111,7 @@ module RubyRunInstrumentor__
|
|
111
111
|
# Also, create metrics hash for a RAILS controller class if it doesn't exist
|
112
112
|
def instrument_target(type, klass, id)
|
113
113
|
$rubyrun_logger.info "instrumenting #{klass.to_s}.#{id.id2name}."
|
114
|
-
create_metrics_hash(klass) if is_rails_controller?(klass
|
114
|
+
create_metrics_hash(klass) if is_rails_controller?(klass)
|
115
115
|
begin
|
116
116
|
case type
|
117
117
|
when 'i'
|
@@ -180,8 +180,8 @@ module RubyRunInstrumentor__
|
|
180
180
|
# 3. When a method ends, report the timings to the response time component but
|
181
181
|
# only if a thread local exists
|
182
182
|
def collect_method_data(obj, klass, mid, *args)
|
183
|
-
tid = get_thread_id
|
184
|
-
create_thread_local(tid, obj.request, klass, mid) if is_rails_controller?(klass
|
183
|
+
tid = get_thread_id
|
184
|
+
create_thread_local(tid, obj.request, klass, mid) if is_rails_controller?(klass)
|
185
185
|
rubyrun_trace = is_in?($rubyrun_trace_hash, klass, mid)
|
186
186
|
if rubyrun_trace
|
187
187
|
invoker = get_caller_detail
|
@@ -101,6 +101,7 @@ module RubyRunMonitor__
|
|
101
101
|
# When the same thread serves a different request, the current thread local
|
102
102
|
# data needs to be rolled up and re-initialized.
|
103
103
|
def create_thread_local(tid, request, klass, mid)
|
104
|
+
return unless ($rubyrun_thread_local[tid] || is_action?(klass, mid))
|
104
105
|
$rubyrun_thread_local[tid] ||= {}
|
105
106
|
init_thread_local(tid, request, klass, mid) unless $rubyrun_thread_local[tid][:req]
|
106
107
|
if $rubyrun_thread_local[tid][:req] != request.object_id
|
@@ -130,7 +131,7 @@ module RubyRunMonitor__
|
|
130
131
|
$rubyrun_thread_local[tid][:outer_dispatch_t] << t
|
131
132
|
elsif is_in_hash?($rubyrun_inner_dispatch_hash, klass, mid)
|
132
133
|
$rubyrun_thread_local[tid][:inner_dispatch_t] << t
|
133
|
-
elsif is_rails_controller?(klass
|
134
|
+
elsif is_rails_controller?(klass)
|
134
135
|
$rubyrun_thread_local[tid][:action_t] = t
|
135
136
|
$rubyrun_thread_local[tid][:scafold_style] = $rubyrun_thread_local[tid][:view_t].empty? ? true : false
|
136
137
|
elsif is_in?(RUBYRUN_THREAD_END_HASH, klass, mid, 'strict')
|
@@ -42,19 +42,22 @@ module RubyRunUtils__
|
|
42
42
|
|
43
43
|
# Return true if a Rails Action Controller class
|
44
44
|
# A module or object has no superclass hence the rescue clause
|
45
|
-
def is_rails_controller?(klass
|
45
|
+
def is_rails_controller?(klass)
|
46
46
|
return true if $rubyrun_controller_classes.include?(klass)
|
47
47
|
$rubyrun_rails_env ||= ENV['RAILS_ENV']
|
48
48
|
begin
|
49
49
|
($rubyrun_controller_classes << klass; return true) if $rubyrun_rails_env &&
|
50
|
-
klass.to_s[-10, 10] == 'Controller' &&
|
51
|
-
is_application_controller(klass) &&
|
52
|
-
!klass.private_instance_methods(false).include?(return_method_name(mid))
|
50
|
+
klass.to_s[-10, 10] == 'Controller' && is_application_controller(klass)
|
53
51
|
rescue
|
54
52
|
end
|
55
53
|
false
|
56
54
|
end
|
57
55
|
|
56
|
+
# Return true if this is an action method in a controller class
|
57
|
+
def is_action?(klass, mid)
|
58
|
+
!klass.private_instance_methods(false).include?(return_method_name(mid))
|
59
|
+
end
|
60
|
+
|
58
61
|
# Given a class, it's deemed to be a Rails Action Controller if one of its
|
59
62
|
# ancestors is ApplicationController
|
60
63
|
def is_application_controller(klass)
|
metadata
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyrun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RubySophic Inc
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: RubyRun Community Edition is an application performance diagnostic solution for Ruby developers. It is meant to help them gain visibility into the behavior of their code in different operating environments, and understand the response time hotspots of typical Rails requests. For more information on usage, support and license, refer to the documents in 'docs' directory in the gem.
|
17
17
|
email: info@rubysophic.com
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions:
|
21
21
|
- ext/extconf.rb
|
22
|
-
|
23
|
-
|
22
|
+
- bin/Rakefile
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
24
25
|
files:
|
25
|
-
- Rakefile
|
26
26
|
- README
|
27
27
|
- LICENSE
|
28
28
|
- lib/rubyrun
|
29
29
|
- lib/rubyrun/rubyrun.rb
|
30
|
+
- lib/rubyrun/rubyrun_boot__.rb
|
30
31
|
- lib/rubyrun/rubyrun_buffer_mgr__.rb
|
31
32
|
- lib/rubyrun/rubyrun_commander__.rb
|
32
33
|
- lib/rubyrun/rubyrun_dad__.rb
|
@@ -40,51 +41,53 @@ files:
|
|
40
41
|
- lib/rubyrun/rubyrun_rss__.rb
|
41
42
|
- lib/rubyrun/rubyrun_tracer__.rb
|
42
43
|
- lib/rubyrun/rubyrun_utils__.rb
|
43
|
-
-
|
44
|
-
- bin/confgure
|
44
|
+
- bin/Rakefile
|
45
45
|
- ext/extconf.rb
|
46
|
-
- ext/rubyrunnative__.bundle
|
47
46
|
- ext/rubyrunnative__.c
|
48
47
|
- ext/rubyrunnative__.def
|
49
48
|
- ext/rubyrunnative__.h
|
50
|
-
- ext/
|
51
|
-
- ext/
|
52
|
-
- ext/
|
53
|
-
-
|
54
|
-
- docs/rubyrun-0.9.
|
55
|
-
- docs/rubyrun-0.9.
|
56
|
-
- docs/rubyrun-0.9.
|
57
|
-
- docs/rubyrun-0.9.
|
58
|
-
- docs/rubyrun-0.9.
|
59
|
-
- docs/rubyrun-0.9.
|
60
|
-
- docs/rubyrun-0.9.
|
61
|
-
- docs/rubyrun-0.9.
|
62
|
-
- docs/rubyrun-0.9.
|
63
|
-
- docs/rubyrun-0.9.
|
64
|
-
- docs/rubyrun-0.9.
|
65
|
-
- docs/rubyrun-0.9.
|
66
|
-
- docs/rubyrun-0.9.
|
67
|
-
- docs/rubyrun-0.9.
|
68
|
-
- docs/rubyrun-0.9.
|
69
|
-
- docs/rubyrun-0.9.
|
70
|
-
- docs/rubyrun-0.9.
|
71
|
-
- docs/rubyrun-0.9.
|
72
|
-
- docs/rubyrun-0.9.
|
73
|
-
- docs/rubyrun-0.9.
|
74
|
-
- docs/rubyrun-0.9.
|
75
|
-
- docs/rubyrun-0.9.
|
76
|
-
- docs/rubyrun-0.9.
|
77
|
-
- docs/rubyrun-0.9.
|
78
|
-
- docs/rubyrun-0.9.
|
79
|
-
- docs/rubyrun-0.9.
|
80
|
-
- docs/rubyrun-0.9.
|
81
|
-
- docs/rubyrun-0.9.
|
49
|
+
- ext/rubyrunnative__ppc-darwin.bundle
|
50
|
+
- ext/rubyrunnative__x86-darwin.bundle
|
51
|
+
- ext/rubyrunnative__x86-linux.so
|
52
|
+
- ext/rubyrunnative__x86-mswin32.so
|
53
|
+
- docs/rubyrun-0.9.5.htm
|
54
|
+
- docs/rubyrun-0.9.5.pdf
|
55
|
+
- docs/rubyrun-0.9.5_files
|
56
|
+
- docs/rubyrun-0.9.5_files/colorschememapping.xml
|
57
|
+
- docs/rubyrun-0.9.5_files/filelist.xml
|
58
|
+
- docs/rubyrun-0.9.5_files/header.htm
|
59
|
+
- docs/rubyrun-0.9.5_files/image001.jpg
|
60
|
+
- docs/rubyrun-0.9.5_files/image002.jpg
|
61
|
+
- docs/rubyrun-0.9.5_files/image003.jpg
|
62
|
+
- docs/rubyrun-0.9.5_files/image004.jpg
|
63
|
+
- docs/rubyrun-0.9.5_files/image005.jpg
|
64
|
+
- docs/rubyrun-0.9.5_files/image006.jpg
|
65
|
+
- docs/rubyrun-0.9.5_files/image007.jpg
|
66
|
+
- docs/rubyrun-0.9.5_files/image008.jpg
|
67
|
+
- docs/rubyrun-0.9.5_files/image009.jpg
|
68
|
+
- docs/rubyrun-0.9.5_files/image010.jpg
|
69
|
+
- docs/rubyrun-0.9.5_files/image011.jpg
|
70
|
+
- docs/rubyrun-0.9.5_files/image012.jpg
|
71
|
+
- docs/rubyrun-0.9.5_files/image013.jpg
|
72
|
+
- docs/rubyrun-0.9.5_files/image014.jpg
|
73
|
+
- docs/rubyrun-0.9.5_files/image015.jpg
|
74
|
+
- docs/rubyrun-0.9.5_files/image016.jpg
|
75
|
+
- docs/rubyrun-0.9.5_files/image017.png
|
76
|
+
- docs/rubyrun-0.9.5_files/image018.jpg
|
77
|
+
- docs/rubyrun-0.9.5_files/image019.jpg
|
78
|
+
- docs/rubyrun-0.9.5_files/image020.jpg
|
79
|
+
- docs/rubyrun-0.9.5_files/image021.jpg
|
80
|
+
- docs/rubyrun-0.9.5_files/image022.png
|
81
|
+
- docs/rubyrun-0.9.5_files/themedata.thmx
|
82
82
|
- etc/rubyrun_opts.yml
|
83
83
|
has_rdoc: true
|
84
84
|
homepage: http://www.rubysophic.com
|
85
85
|
post_install_message:
|
86
|
-
rdoc_options:
|
87
|
-
|
86
|
+
rdoc_options:
|
87
|
+
- --title
|
88
|
+
- RubyRun Community Edition
|
89
|
+
- --line-numbers
|
90
|
+
- --inline-source
|
88
91
|
require_paths:
|
89
92
|
- .
|
90
93
|
- lib
|
@@ -107,6 +110,6 @@ rubyforge_project: rubyrunce
|
|
107
110
|
rubygems_version: 1.1.1
|
108
111
|
signing_key:
|
109
112
|
specification_version: 2
|
110
|
-
summary:
|
113
|
+
summary: RubyRun Community Edition is an application performance diagnostic solution for Ruby developers
|
111
114
|
test_files: []
|
112
115
|
|