redis-stat 0.3.2-java → 0.3.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/redis-stat.rb +18 -0
- data/lib/redis-stat/constants.rb +7 -1
- data/lib/redis-stat/server.rb +1 -1
- data/lib/redis-stat/server/public/css/site.css +1 -1
- data/lib/redis-stat/version.rb +1 -1
- data/redis-stat.gemspec +1 -0
- metadata +229 -180
data/README.md
CHANGED
data/lib/redis-stat.rb
CHANGED
@@ -290,6 +290,14 @@ private
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
|
+
get_ratio = lambda do |x, y|
|
294
|
+
if x > 0 || y > 0
|
295
|
+
x / (x + y) * 100
|
296
|
+
else
|
297
|
+
nil
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
293
301
|
case key
|
294
302
|
when :at
|
295
303
|
val = Time.now.strftime('%H:%M:%S')
|
@@ -310,6 +318,16 @@ private
|
|
310
318
|
when :used_memory, :used_memory_rss, :aof_current_size, :aof_base_size
|
311
319
|
val = info.sumf(key)
|
312
320
|
[humanize_number(val.to_i, true), val]
|
321
|
+
when :keyspace_hit_ratio
|
322
|
+
hits = info.sumf(:keyspace_hits)
|
323
|
+
misses = info.sumf(:keyspace_misses)
|
324
|
+
val = get_ratio.call(hits, misses)
|
325
|
+
[humanize_number(val), val]
|
326
|
+
when :keyspace_hit_ratio_per_second
|
327
|
+
hits = get_diff.call(:keyspace_hits) || 0
|
328
|
+
misses = get_diff.call(:keyspace_misses) || 0
|
329
|
+
val = get_ratio.call(hits, misses)
|
330
|
+
[humanize_number(val), val]
|
313
331
|
else
|
314
332
|
val = info.sumf(key)
|
315
333
|
[humanize_number(val), val]
|
data/lib/redis-stat/constants.rb
CHANGED
@@ -31,10 +31,10 @@ class RedisStat
|
|
31
31
|
:total_commands_processed_per_second,
|
32
32
|
:expired_keys_per_second,
|
33
33
|
:evicted_keys_per_second,
|
34
|
+
:keyspace_hit_ratio_per_second,
|
34
35
|
:keyspace_hits_per_second,
|
35
36
|
:keyspace_misses_per_second,
|
36
37
|
:aof_current_size,
|
37
|
-
:pubsub_channels,
|
38
38
|
],
|
39
39
|
:verbose => [
|
40
40
|
:at,
|
@@ -52,6 +52,8 @@ class RedisStat
|
|
52
52
|
:expired_keys,
|
53
53
|
:evicted_keys_per_second,
|
54
54
|
:evicted_keys,
|
55
|
+
# :keyspace_hit_ratio,
|
56
|
+
:keyspace_hit_ratio_per_second,
|
55
57
|
:keyspace_hits_per_second,
|
56
58
|
:keyspace_hits,
|
57
59
|
:keyspace_misses_per_second,
|
@@ -84,6 +86,8 @@ class RedisStat
|
|
84
86
|
:keyspace_hits_per_second => [:magenta, :bold],
|
85
87
|
:keyspace_misses => [:magenta],
|
86
88
|
:keyspace_misses_per_second => [:magenta],
|
89
|
+
:keyspace_hit_ratio => [:magenta, :bold],
|
90
|
+
:keyspace_hit_ratio_per_second => [:magenta, :bold],
|
87
91
|
:aof_current_size => [:cyan],
|
88
92
|
:aof_base_size => [:cyan],
|
89
93
|
:rdb_changes_since_last_save => [:green, :bold],
|
@@ -111,6 +115,8 @@ class RedisStat
|
|
111
115
|
:keyspace_hits_per_second => 'hit/s',
|
112
116
|
:keyspace_misses => 'mis',
|
113
117
|
:keyspace_misses_per_second => 'mis/s',
|
118
|
+
:keyspace_hit_ratio => 'hit%',
|
119
|
+
:keyspace_hit_ratio_per_second => 'hit%/s',
|
114
120
|
:aof_current_size => 'aofcs',
|
115
121
|
:aof_base_size => 'aofbs',
|
116
122
|
:rdb_changes_since_last_save => 'chsv',
|
data/lib/redis-stat/server.rb
CHANGED
@@ -59,7 +59,7 @@ class Server < Sinatra::Base
|
|
59
59
|
static = Hash[settings.redis_stat.tab_measures.map { |stat|
|
60
60
|
[stat, info[stat]]
|
61
61
|
}]
|
62
|
-
data = {:at => Time.now.to_i, :static => static, :dynamic => data}
|
62
|
+
data = {:at => (Time.now.to_f * 1000).to_i, :static => static, :dynamic => data}
|
63
63
|
|
64
64
|
hist = settings.history
|
65
65
|
settings.mutex.synchronize do
|
data/lib/redis-stat/version.rb
CHANGED
data/redis-stat.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = %q{A real-time Redis monitoring tool written in Ruby}
|
8
8
|
gem.summary = %q{A real-time Redis monitoring tool written in Ruby}
|
9
9
|
gem.homepage = "https://github.com/junegunn/redis-stat"
|
10
|
+
gem.license = 'MIT'
|
10
11
|
|
11
12
|
gem.platform = 'java' if RUBY_PLATFORM == 'java'
|
12
13
|
gem.files = `git ls-files`.split("\n").reject { |f| f =~ /^screenshots/ }
|
metadata
CHANGED
@@ -1,195 +1,244 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-stat
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 0.3.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.3.3
|
6
6
|
platform: java
|
7
|
-
authors:
|
8
|
-
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Junegunn Choi
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
12
|
+
date: 2012-12-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ansi
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.4.3
|
21
|
+
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.4.3
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :runtime
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: redis
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ~>
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 3.0.2
|
37
|
+
none: false
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.0.2
|
43
|
+
none: false
|
44
|
+
prerelease: false
|
45
|
+
type: :runtime
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: tabularize
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ~>
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.2.9
|
53
|
+
none: false
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 0.2.9
|
59
|
+
none: false
|
60
|
+
prerelease: false
|
61
|
+
type: :runtime
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: insensitive_hash
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.3.0
|
69
|
+
none: false
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.3.0
|
75
|
+
none: false
|
76
|
+
prerelease: false
|
77
|
+
type: :runtime
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: parallelize
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.4.0
|
85
|
+
none: false
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.4.0
|
91
|
+
none: false
|
92
|
+
prerelease: false
|
93
|
+
type: :runtime
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: si
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.1.4
|
101
|
+
none: false
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ~>
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.1.4
|
107
|
+
none: false
|
108
|
+
prerelease: false
|
109
|
+
type: :runtime
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: sinatra
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ~>
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 1.3.3
|
117
|
+
none: false
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ~>
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.3.3
|
123
|
+
none: false
|
124
|
+
prerelease: false
|
125
|
+
type: :runtime
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: json
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.7.5
|
133
|
+
none: false
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.7.5
|
139
|
+
none: false
|
140
|
+
prerelease: false
|
141
|
+
type: :runtime
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: puma
|
144
|
+
version_requirements: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ~>
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 1.6.3
|
149
|
+
none: false
|
150
|
+
requirement: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ~>
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 1.6.3
|
155
|
+
none: false
|
156
|
+
prerelease: false
|
157
|
+
type: :runtime
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: test-unit
|
160
|
+
version_requirements: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: !binary |-
|
165
|
+
MA==
|
166
|
+
none: false
|
167
|
+
requirement: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ! '>='
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: !binary |-
|
172
|
+
MA==
|
173
|
+
none: false
|
174
|
+
prerelease: false
|
175
|
+
type: :development
|
125
176
|
description: A real-time Redis monitoring tool written in Ruby
|
126
|
-
email:
|
127
|
-
|
128
|
-
executables:
|
129
|
-
|
177
|
+
email:
|
178
|
+
- junegunn.c@gmail.com
|
179
|
+
executables:
|
180
|
+
- redis-stat
|
130
181
|
extensions: []
|
131
|
-
|
132
182
|
extra_rdoc_files: []
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
- test/test_redis-stat.rb
|
183
|
+
files:
|
184
|
+
- .gitignore
|
185
|
+
- Gemfile
|
186
|
+
- LICENSE
|
187
|
+
- README.md
|
188
|
+
- Rakefile
|
189
|
+
- bin/redis-stat
|
190
|
+
- lib/redis-stat.rb
|
191
|
+
- lib/redis-stat/constants.rb
|
192
|
+
- lib/redis-stat/option.rb
|
193
|
+
- lib/redis-stat/server.rb
|
194
|
+
- lib/redis-stat/server/public/bootstrap/css/bootstrap-responsive.min.css
|
195
|
+
- lib/redis-stat/server/public/bootstrap/css/bootstrap.min.css
|
196
|
+
- lib/redis-stat/server/public/bootstrap/img/glyphicons-halflings-white.png
|
197
|
+
- lib/redis-stat/server/public/bootstrap/img/glyphicons-halflings.png
|
198
|
+
- lib/redis-stat/server/public/bootstrap/js/bootstrap.min.js
|
199
|
+
- lib/redis-stat/server/public/css/site.css
|
200
|
+
- lib/redis-stat/server/public/favicon.ico
|
201
|
+
- lib/redis-stat/server/public/favicon.png
|
202
|
+
- lib/redis-stat/server/public/forkme.png
|
203
|
+
- lib/redis-stat/server/public/jqplot/jqplot.canvasAxisLabelRenderer.min.js
|
204
|
+
- lib/redis-stat/server/public/jqplot/jqplot.canvasAxisTickRenderer.min.js
|
205
|
+
- lib/redis-stat/server/public/jqplot/jqplot.canvasTextRenderer.min.js
|
206
|
+
- lib/redis-stat/server/public/jqplot/jquery.jqplot.min.css
|
207
|
+
- lib/redis-stat/server/public/jqplot/jquery.jqplot.min.js
|
208
|
+
- lib/redis-stat/server/public/jquery-1.8.2.min.js
|
209
|
+
- lib/redis-stat/server/public/js/site.js
|
210
|
+
- lib/redis-stat/server/views/index.erb
|
211
|
+
- lib/redis-stat/version.rb
|
212
|
+
- redis-stat.gemspec
|
213
|
+
- test/bin_helper.rb
|
214
|
+
- test/test_redis-stat.rb
|
166
215
|
homepage: https://github.com/junegunn/redis-stat
|
167
|
-
licenses:
|
168
|
-
|
169
|
-
post_install_message:
|
216
|
+
licenses:
|
217
|
+
- MIT
|
218
|
+
post_install_message:
|
170
219
|
rdoc_options: []
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
220
|
+
require_paths:
|
221
|
+
- lib
|
222
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
223
|
+
requirements:
|
224
|
+
- - ! '>='
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: !binary |-
|
227
|
+
MA==
|
175
228
|
none: false
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
229
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
|
+
requirements:
|
231
|
+
- - ! '>='
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: !binary |-
|
234
|
+
MA==
|
181
235
|
none: false
|
182
|
-
requirements:
|
183
|
-
- - ">="
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
version: "0"
|
186
236
|
requirements: []
|
187
|
-
|
188
|
-
rubyforge_project:
|
237
|
+
rubyforge_project:
|
189
238
|
rubygems_version: 1.8.24
|
190
|
-
signing_key:
|
239
|
+
signing_key:
|
191
240
|
specification_version: 3
|
192
241
|
summary: A real-time Redis monitoring tool written in Ruby
|
193
|
-
test_files:
|
194
|
-
|
195
|
-
|
242
|
+
test_files:
|
243
|
+
- test/bin_helper.rb
|
244
|
+
- test/test_redis-stat.rb
|