Class: Maatkit::QueryProfiler
- Inherits:
-
Object
- Object
- Maatkit::QueryProfiler
- Defined in:
- lib/maatkit-ruby/mk-query-profiler.rb
Overview
Execute SQL statements and print statistics, or measure activity caused by other processes.
Maatkit::QueryProfiler.new( array, str, array)
Instance Attribute Summary collapse
-
#allow_cache ⇒ Object
FALSE.
-
#ask_pass ⇒ Object
FALSE.
-
#calibrate ⇒ Object
TRUE.
-
#charset ⇒ Object
(No # value).
-
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_query_profiler.conf,/home/joel/.maatkit.conf,/home/joel/.mk_query_profiler.conf.
-
#database ⇒ Object
(No # value).
-
#defaults_file ⇒ Object
(No # value).
-
#external ⇒ Object
FALSE.
-
#flush ⇒ Object
0.
-
#help ⇒ Object
TRUE.
-
#host ⇒ Object
(No # value).
-
#innodb ⇒ Object
TRUE.
-
#only ⇒ Object
(No # value).
-
#password ⇒ Object
(No # value).
-
#path_to_mk_query_profiler ⇒ Object
Sets the executable path, otherwise the environment path will be used.
-
#pid ⇒ Object
(No # value).
-
#port ⇒ Object
(No # value).
-
#separate ⇒ Object
FALSE.
-
#session ⇒ Object
TRUE.
-
#set_vars ⇒ Object
wait_timeout=10000.
-
#socket ⇒ Object
(No # value).
-
#tab ⇒ Object
FALSE.
-
#user ⇒ Object
(No # value).
-
#verbose ⇒ Object
0.
-
#verify ⇒ Object
FALSE.
-
#version ⇒ Object
FALSE.
Instance Method Summary collapse
-
#initialize ⇒ QueryProfiler
constructor
Returns a new QueryProfiler Object.
-
#start(options = nil) ⇒ Object
Execute the command.
Constructor Details
#initialize ⇒ QueryProfiler
Returns a new QueryProfiler Object
49 50 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 49 def initialize() end |
Instance Attribute Details
#allow_cache ⇒ Object
FALSE
15 16 17 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 15 def allow_cache @allow_cache end |
#ask_pass ⇒ Object
FALSE
16 17 18 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 16 def ask_pass @ask_pass end |
#calibrate ⇒ Object
TRUE
17 18 19 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 17 def calibrate @calibrate end |
#charset ⇒ Object
(No # value)
18 19 20 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 18 def charset @charset end |
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_query_profiler.conf,/home/joel/.maatkit.conf,/home/joel/.mk_query_profiler.conf
19 20 21 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 19 def config @config end |
#database ⇒ Object
(No # value)
20 21 22 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 20 def database @database end |
#defaults_file ⇒ Object
(No # value)
21 22 23 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 21 def defaults_file @defaults_file end |
#external ⇒ Object
FALSE
22 23 24 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 22 def external @external end |
#flush ⇒ Object
0
23 24 25 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 23 def flush @flush end |
#help ⇒ Object
TRUE
24 25 26 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 24 def help @help end |
#host ⇒ Object
(No # value)
25 26 27 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 25 def host @host end |
#innodb ⇒ Object
TRUE
26 27 28 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 26 def innodb @innodb end |
#only ⇒ Object
(No # value)
27 28 29 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 27 def only @only end |
#password ⇒ Object
(No # value)
28 29 30 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 28 def password @password end |
#path_to_mk_query_profiler ⇒ Object
Sets the executable path, otherwise the environment path will be used.
44 45 46 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 44 def path_to_mk_query_profiler @path_to_mk_query_profiler end |
#pid ⇒ Object
(No # value)
29 30 31 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 29 def pid @pid end |
#port ⇒ Object
(No # value)
30 31 32 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 30 def port @port end |
#separate ⇒ Object
FALSE
31 32 33 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 31 def separate @separate end |
#session ⇒ Object
TRUE
32 33 34 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 32 def session @session end |
#set_vars ⇒ Object
wait_timeout=10000
33 34 35 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 33 def set_vars @set_vars end |
#socket ⇒ Object
(No # value)
34 35 36 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 34 def socket @socket end |
#tab ⇒ Object
FALSE
35 36 37 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 35 def tab @tab end |
#user ⇒ Object
(No # value)
36 37 38 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 36 def user @user end |
#verbose ⇒ Object
0
37 38 39 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 37 def verbose @verbose end |
#verify ⇒ Object
FALSE
38 39 40 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 38 def verify @verify end |
#version ⇒ Object
FALSE
39 40 41 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 39 def version @version end |
Instance Method Details
#start(options = nil) ⇒ Object
Execute the command
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/maatkit-ruby/mk-query-profiler.rb', line 55 def start( = nil) tmp = Tempfile.new('tmp') command = option_string() + .to_s + " 2> " + tmp.path success = system(command) if success begin while (line = tmp.readline) line.chomp selected_string = line end rescue EOFError tmp.close end return selected_string else tmp.close! return success end end |