Class: Maatkit::VisualExplain
- Inherits:
-
Object
- Object
- Maatkit::VisualExplain
- Defined in:
- lib/maatkit-ruby/mk-visual-explain.rb
Overview
Analyze MySQL variables and advise on possible problems.
Maatkit::VisualExplain.new( array, str, array)
Instance Attribute Summary collapse
-
#ask_pass ⇒ Object
FALSE.
-
#charset ⇒ Object
(No # value).
-
#clustered_pk ⇒ Object
FALSE.
-
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_visual_explain.conf,/home/joel/.maatkit.conf,/home/joel/.mk_visual_explain.conf.
-
#connect ⇒ Object
FALSE.
-
#database ⇒ Object
(No # value).
-
#defaults_file ⇒ Object
(No # value).
-
#format ⇒ Object
tree.
-
#help ⇒ Object
TRUE.
-
#host ⇒ Object
(No # value).
-
#password ⇒ Object
(No # value).
-
#path_to_mk_visual_explain ⇒ Object
Sets the executable path, otherwise the environment path will be used.
-
#pid ⇒ Object
(No # value).
-
#port ⇒ Object
(No # value).
-
#set_vars ⇒ Object
wait_timeout=10000.
-
#socket ⇒ Object
(No # value).
-
#user ⇒ Object
(No # value).
-
#version ⇒ Object
FALSE.
Instance Method Summary collapse
-
#initialize ⇒ VisualExplain
constructor
Returns a new VisualExplain Object.
-
#start(options = nil) ⇒ Object
Execute the command.
Constructor Details
#initialize ⇒ VisualExplain
Returns a new VisualExplain Object
41 42 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 41 def initialize() end |
Instance Attribute Details
#ask_pass ⇒ Object
FALSE
15 16 17 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 15 def ask_pass @ask_pass end |
#charset ⇒ Object
(No # value)
16 17 18 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 16 def charset @charset end |
#clustered_pk ⇒ Object
FALSE
17 18 19 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 17 def clustered_pk @clustered_pk end |
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_visual_explain.conf,/home/joel/.maatkit.conf,/home/joel/.mk_visual_explain.conf
18 19 20 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 18 def config @config end |
#connect ⇒ Object
FALSE
19 20 21 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 19 def connect @connect end |
#database ⇒ Object
(No # value)
20 21 22 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 20 def database @database end |
#defaults_file ⇒ Object
(No # value)
21 22 23 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 21 def defaults_file @defaults_file end |
#format ⇒ Object
tree
22 23 24 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 22 def format @format end |
#help ⇒ Object
TRUE
23 24 25 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 23 def help @help end |
#host ⇒ Object
(No # value)
24 25 26 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 24 def host @host end |
#password ⇒ Object
(No # value)
25 26 27 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 25 def password @password end |
#path_to_mk_visual_explain ⇒ Object
Sets the executable path, otherwise the environment path will be used.
36 37 38 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 36 def path_to_mk_visual_explain @path_to_mk_visual_explain end |
#pid ⇒ Object
(No # value)
26 27 28 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 26 def pid @pid end |
#port ⇒ Object
(No # value)
27 28 29 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 27 def port @port end |
#set_vars ⇒ Object
wait_timeout=10000
28 29 30 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 28 def set_vars @set_vars end |
#socket ⇒ Object
(No # value)
29 30 31 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 29 def socket @socket end |
#user ⇒ Object
(No # value)
30 31 32 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 30 def user @user end |
#version ⇒ Object
FALSE
31 32 33 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 31 def version @version end |
Instance Method Details
#start(options = nil) ⇒ Object
Execute the command
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/maatkit-ruby/mk-visual-explain.rb', line 47 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 |