Class: Maatkit::Kill
- Inherits:
-
Object
- Object
- Maatkit::Kill
- Defined in:
- lib/maatkit-ruby/mk-kill.rb
Overview
Kill MySQL queries that match certain criteria.
Maatkit::Kill.new( array, str, array)
Instance Attribute Summary collapse
-
#all ⇒ Object
FALSE.
-
#ask_pass ⇒ Object
FALSE.
-
#busy_time ⇒ Object
(No value).
-
#charset ⇒ Object
(No value).
-
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_kill.conf,/home/joel/.maatkit.conf,/home/joel/.mk_kill.conf.
-
#daemonize ⇒ Object
FALSE.
-
#defaults_file ⇒ Object
(No value).
-
#execute_command ⇒ Object
(No value).
-
#heartbeat ⇒ Object
FALSE.
-
#help ⇒ Object
TRUE.
-
#host ⇒ Object
(No value).
-
#idle_time ⇒ Object
(No value).
-
#ignore_command ⇒ Object
(No value).
-
#ignore_db ⇒ Object
(No value).
-
#ignore_host ⇒ Object
(No value).
-
#ignore_info ⇒ Object
(No value).
-
#ignore_self ⇒ Object
TRUE.
-
#ignore_state ⇒ Object
Locked.
-
#ignore_user ⇒ Object
(No value).
-
#interval ⇒ Object
30.
-
#iterations ⇒ Object
1.
-
#kill ⇒ Object
FALSE.
-
#kill_query ⇒ Object
FALSE.
-
#log ⇒ Object
(No value).
-
#match_command ⇒ Object
(No value).
-
#match_db ⇒ Object
(No value).
-
#match_host ⇒ Object
(No value).
-
#match_info ⇒ Object
(No value).
-
#match_state ⇒ Object
(No value).
-
#match_user ⇒ Object
(No value).
-
#only_oldest ⇒ Object
TRUE.
-
#password ⇒ Object
(No value).
-
#path_to_mk_kill ⇒ Object
Sets the executable path, otherwise the environment path will be used.
-
#pid ⇒ Object
(No value).
-
#port ⇒ Object
(No value).
-
#print ⇒ Object
FALSE.
-
#replication_threads ⇒ Object
FALSE.
-
#run_time ⇒ Object
(No value).
-
#set_vars ⇒ Object
wait_timeout=10000.
-
#socket ⇒ Object
(No value).
-
#user ⇒ Object
(No value).
-
#version ⇒ Object
FALSE.
-
#wait_after_kill ⇒ Object
(No value).
-
#wait_before_kill ⇒ Object
(No value).
Instance Method Summary collapse
-
#initialize ⇒ Kill
constructor
Returns a new Kill Object.
-
#start(options = nil) ⇒ Object
Execute the command.
Constructor Details
#initialize ⇒ Kill
Returns a new Kill Object
67 68 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 67 def initialize() end |
Instance Attribute Details
#all ⇒ Object
FALSE
15 16 17 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 15 def all @all end |
#ask_pass ⇒ Object
FALSE
16 17 18 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 16 def ask_pass @ask_pass end |
#busy_time ⇒ Object
(No value)
17 18 19 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 17 def busy_time @busy_time end |
#charset ⇒ Object
(No value)
18 19 20 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 18 def charset @charset end |
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_kill.conf,/home/joel/.maatkit.conf,/home/joel/.mk_kill.conf
19 20 21 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 19 def config @config end |
#daemonize ⇒ Object
FALSE
20 21 22 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 20 def daemonize @daemonize end |
#defaults_file ⇒ Object
(No value)
21 22 23 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 21 def defaults_file @defaults_file end |
#execute_command ⇒ Object
(No value)
22 23 24 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 22 def execute_command @execute_command end |
#heartbeat ⇒ Object
FALSE
23 24 25 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 23 def heartbeat @heartbeat end |
#help ⇒ Object
TRUE
24 25 26 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 24 def help @help end |
#host ⇒ Object
(No value)
25 26 27 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 25 def host @host end |
#idle_time ⇒ Object
(No value)
26 27 28 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 26 def idle_time @idle_time end |
#ignore_command ⇒ Object
(No value)
27 28 29 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 27 def ignore_command @ignore_command end |
#ignore_db ⇒ Object
(No value)
28 29 30 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 28 def ignore_db @ignore_db end |
#ignore_host ⇒ Object
(No value)
29 30 31 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 29 def ignore_host @ignore_host end |
#ignore_info ⇒ Object
(No value)
30 31 32 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 30 def ignore_info @ignore_info end |
#ignore_self ⇒ Object
TRUE
31 32 33 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 31 def ignore_self @ignore_self end |
#ignore_state ⇒ Object
Locked
32 33 34 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 32 def ignore_state @ignore_state end |
#ignore_user ⇒ Object
(No value)
33 34 35 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 33 def ignore_user @ignore_user end |
#interval ⇒ Object
30
34 35 36 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 34 def interval @interval end |
#iterations ⇒ Object
1
35 36 37 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 35 def iterations @iterations end |
#kill ⇒ Object
FALSE
36 37 38 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 36 def kill @kill end |
#kill_query ⇒ Object
FALSE
37 38 39 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 37 def kill_query @kill_query end |
#log ⇒ Object
(No value)
38 39 40 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 38 def log @log end |
#match_command ⇒ Object
(No value)
39 40 41 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 39 def match_command @match_command end |
#match_db ⇒ Object
(No value)
40 41 42 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 40 def match_db @match_db end |
#match_host ⇒ Object
(No value)
41 42 43 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 41 def match_host @match_host end |
#match_info ⇒ Object
(No value)
42 43 44 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 42 def match_info @match_info end |
#match_state ⇒ Object
(No value)
43 44 45 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 43 def match_state @match_state end |
#match_user ⇒ Object
(No value)
44 45 46 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 44 def match_user @match_user end |
#only_oldest ⇒ Object
TRUE
45 46 47 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 45 def only_oldest @only_oldest end |
#password ⇒ Object
(No value)
46 47 48 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 46 def password @password end |
#path_to_mk_kill ⇒ Object
Sets the executable path, otherwise the environment path will be used.
62 63 64 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 62 def path_to_mk_kill @path_to_mk_kill end |
#pid ⇒ Object
(No value)
47 48 49 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 47 def pid @pid end |
#port ⇒ Object
(No value)
48 49 50 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 48 def port @port end |
#print ⇒ Object
FALSE
49 50 51 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 49 def print @print end |
#replication_threads ⇒ Object
FALSE
50 51 52 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 50 def replication_threads @replication_threads end |
#run_time ⇒ Object
(No value)
51 52 53 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 51 def run_time @run_time end |
#set_vars ⇒ Object
wait_timeout=10000
52 53 54 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 52 def set_vars @set_vars end |
#socket ⇒ Object
(No value)
53 54 55 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 53 def socket @socket end |
#user ⇒ Object
(No value)
54 55 56 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 54 def user @user end |
#version ⇒ Object
FALSE
55 56 57 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 55 def version @version end |
#wait_after_kill ⇒ Object
(No value)
56 57 58 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 56 def wait_after_kill @wait_after_kill end |
#wait_before_kill ⇒ Object
(No value)
57 58 59 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 57 def wait_before_kill @wait_before_kill end |
Instance Method Details
#start(options = nil) ⇒ Object
Execute the command
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/maatkit-ruby/mk-kill.rb', line 73 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 |