mmtop 1.0.0.rc3 → 1.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mmtop/host.rb +2 -0
- data/lib/mmtop/mmconfig.rb +1 -1
- data/lib/mmtop/process.rb +8 -0
- data/lib/mmtop/term_printer.rb +3 -1
- metadata +21 -5
data/lib/mmtop/host.rb
CHANGED
@@ -15,6 +15,7 @@ module MMTop
|
|
15
15
|
@display_name = @name
|
16
16
|
@comment = options['comment']
|
17
17
|
@last_queries = nil
|
18
|
+
@port = options['port'] || 3306
|
18
19
|
@hide_if_empty = options['hide_if_empty']
|
19
20
|
|
20
21
|
initialize_mysql2_cx(m2opts)
|
@@ -35,6 +36,7 @@ module MMTop
|
|
35
36
|
end
|
36
37
|
|
37
38
|
attr_accessor :display_name, :name, :comment, :options, :ip
|
39
|
+
attr_reader :port
|
38
40
|
|
39
41
|
def hide_if_empty?
|
40
42
|
!!@hide_if_empty
|
data/lib/mmtop/mmconfig.rb
CHANGED
data/lib/mmtop/process.rb
CHANGED
@@ -10,6 +10,7 @@ module MMTop
|
|
10
10
|
@client_port ||= ""
|
11
11
|
@db = result[:db]
|
12
12
|
@host = host
|
13
|
+
clean_sql!
|
13
14
|
end
|
14
15
|
|
15
16
|
attr_accessor :query, :status, :time, :client, :host, :db
|
@@ -26,6 +27,13 @@ module MMTop
|
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
30
|
+
def clean_sql!
|
31
|
+
if @query && !@query.valid_encoding?
|
32
|
+
@query = @query.chars.select { |c| c.valid_encoding? }.join
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
29
37
|
def sql
|
30
38
|
@query
|
31
39
|
end
|
data/lib/mmtop/term_printer.rb
CHANGED
@@ -151,7 +151,9 @@ module MMTop
|
|
151
151
|
str += info_sep + column_value(6, info.stats[:qps].to_s)
|
152
152
|
str += info_sep + column_value(7, info.host.comment || '')
|
153
153
|
str += info_sep
|
154
|
-
|
154
|
+
|
155
|
+
fill_count = (@x - str.size - 1)
|
156
|
+
str += "-".dark_gray * fill_count if fill_count > 0
|
155
157
|
str += pipe
|
156
158
|
puts str
|
157
159
|
info.processlist.each do |p|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmtop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc4
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mysql2
|
@@ -91,6 +91,22 @@ dependencies:
|
|
91
91
|
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: mysql_isolated_server
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
94
110
|
description:
|
95
111
|
email:
|
96
112
|
- ben@gimbo.net
|
@@ -116,8 +132,7 @@ files:
|
|
116
132
|
- lib/mmtop/term_input.rb
|
117
133
|
- lib/mmtop/term_printer.rb
|
118
134
|
- lib/mmtop.rb
|
119
|
-
-
|
120
|
-
YmluL21tdG9w
|
135
|
+
- bin/mmtop
|
121
136
|
homepage: http://github.com/osheroff/mmtop
|
122
137
|
licenses: []
|
123
138
|
post_install_message:
|
@@ -138,8 +153,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
153
|
version: 1.3.1
|
139
154
|
requirements: []
|
140
155
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.8.
|
156
|
+
rubygems_version: 1.8.25
|
142
157
|
signing_key:
|
143
158
|
specification_version: 3
|
144
159
|
summary: A mytop-ish variant that can watch many mysql servers
|
145
160
|
test_files: []
|
161
|
+
has_rdoc:
|