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 CHANGED
@@ -78,6 +78,7 @@ killall -9 redis-stat-daemon
78
78
 
79
79
  ## Contributors
80
80
  - [Chris Meisl](https://github.com/cmeisl)
81
+ - [Hyunseok Hwang](https://github.com/frhwang)
81
82
 
82
83
  ## Contributing
83
84
 
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]
@@ -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',
@@ -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
@@ -35,7 +35,7 @@ body {
35
35
  }
36
36
 
37
37
  #stat_table.verbose, #stat_table h5.verbose {
38
- font-size: 12px;
38
+ font-size: 11px;
39
39
  }
40
40
 
41
41
  #info_table th {
@@ -1,3 +1,3 @@
1
1
  class RedisStat
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
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.2
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.3.3
6
6
  platform: java
7
- authors:
8
- - Junegunn Choi
9
- autorequire:
7
+ authors:
8
+ - Junegunn Choi
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-12-03 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: ansi
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 1.4.3
24
- type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: redis
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 3.0.2
35
- type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: tabularize
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 0.2.9
46
- type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: insensitive_hash
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ~>
55
- - !ruby/object:Gem::Version
56
- version: 0.3.0
57
- type: :runtime
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: parallelize
61
- prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ~>
66
- - !ruby/object:Gem::Version
67
- version: 0.4.0
68
- type: :runtime
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: si
72
- prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: 0.1.4
79
- type: :runtime
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
82
- name: sinatra
83
- prerelease: false
84
- requirement: &id007 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- version: 1.3.3
90
- type: :runtime
91
- version_requirements: *id007
92
- - !ruby/object:Gem::Dependency
93
- name: json
94
- prerelease: false
95
- requirement: &id008 !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
98
- - - ~>
99
- - !ruby/object:Gem::Version
100
- version: 1.7.5
101
- type: :runtime
102
- version_requirements: *id008
103
- - !ruby/object:Gem::Dependency
104
- name: puma
105
- prerelease: false
106
- requirement: &id009 !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ~>
110
- - !ruby/object:Gem::Version
111
- version: 1.6.3
112
- type: :runtime
113
- version_requirements: *id009
114
- - !ruby/object:Gem::Dependency
115
- name: test-unit
116
- prerelease: false
117
- requirement: &id010 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- version: "0"
123
- type: :development
124
- version_requirements: *id010
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
- - junegunn.c@gmail.com
128
- executables:
129
- - redis-stat
177
+ email:
178
+ - junegunn.c@gmail.com
179
+ executables:
180
+ - redis-stat
130
181
  extensions: []
131
-
132
182
  extra_rdoc_files: []
133
-
134
- files:
135
- - .gitignore
136
- - Gemfile
137
- - LICENSE
138
- - README.md
139
- - Rakefile
140
- - bin/redis-stat
141
- - lib/redis-stat.rb
142
- - lib/redis-stat/constants.rb
143
- - lib/redis-stat/option.rb
144
- - lib/redis-stat/server.rb
145
- - lib/redis-stat/server/public/bootstrap/css/bootstrap-responsive.min.css
146
- - lib/redis-stat/server/public/bootstrap/css/bootstrap.min.css
147
- - lib/redis-stat/server/public/bootstrap/img/glyphicons-halflings-white.png
148
- - lib/redis-stat/server/public/bootstrap/img/glyphicons-halflings.png
149
- - lib/redis-stat/server/public/bootstrap/js/bootstrap.min.js
150
- - lib/redis-stat/server/public/css/site.css
151
- - lib/redis-stat/server/public/favicon.ico
152
- - lib/redis-stat/server/public/favicon.png
153
- - lib/redis-stat/server/public/forkme.png
154
- - lib/redis-stat/server/public/jqplot/jqplot.canvasAxisLabelRenderer.min.js
155
- - lib/redis-stat/server/public/jqplot/jqplot.canvasAxisTickRenderer.min.js
156
- - lib/redis-stat/server/public/jqplot/jqplot.canvasTextRenderer.min.js
157
- - lib/redis-stat/server/public/jqplot/jquery.jqplot.min.css
158
- - lib/redis-stat/server/public/jqplot/jquery.jqplot.min.js
159
- - lib/redis-stat/server/public/jquery-1.8.2.min.js
160
- - lib/redis-stat/server/public/js/site.js
161
- - lib/redis-stat/server/views/index.erb
162
- - lib/redis-stat/version.rb
163
- - redis-stat.gemspec
164
- - test/bin_helper.rb
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
- require_paths:
173
- - lib
174
- required_ruby_version: !ruby/object:Gem::Requirement
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
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: "0"
180
- required_rubygems_version: !ruby/object:Gem::Requirement
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
- - test/bin_helper.rb
195
- - test/test_redis-stat.rb
242
+ test_files:
243
+ - test/bin_helper.rb
244
+ - test/test_redis-stat.rb