mmtop 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mmtop/commands/kill.rb +8 -4
- data/lib/mmtop/process.rb +5 -1
- metadata +4 -4
data/lib/mmtop/commands/kill.rb
CHANGED
@@ -44,13 +44,17 @@ MMTop::Command.register do |c|
|
|
44
44
|
end
|
45
45
|
|
46
46
|
MMTop::Command.register do |c|
|
47
|
-
c.regexp %r{^k(:?ill)?\s+l(:?ong)?\s+(\d+)}
|
48
|
-
c.usage "kill long TIME"
|
49
|
-
c.explain "Kill any queries over TIME seconds"
|
47
|
+
c.regexp %r{^k(:?ill)?\s+l(:?ong)?\s+(\d+)\s*(\w*)}
|
48
|
+
c.usage "kill long TIME [SERVER]"
|
49
|
+
c.explain "Kill any queries over TIME seconds on optional server"
|
50
50
|
c.command do |cmd, config|
|
51
51
|
cmd =~ c.regexp
|
52
52
|
time = $3.to_i
|
53
|
-
|
53
|
+
server = $4.strip
|
54
|
+
list = config.all_processes.select { |p|
|
55
|
+
p.time > time && p.sql =~ /select/i && (server.nil? || server.size == 0 || (server == p.host.name))
|
56
|
+
}
|
57
|
+
MMTop::Command.kill_prompt(list)
|
54
58
|
end
|
55
59
|
end
|
56
60
|
|
data/lib/mmtop/process.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmtop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Osheroff
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-18 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|