redis-stat 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9eaec8ee427805bdd50e37c06fbb975619c82558
4
- data.tar.gz: 0fb9d8c58a1d81fd2b852ded358fea213dbe7cca
3
+ metadata.gz: e366dade4a3be41e9d69eabeacae83624836ccb0
4
+ data.tar.gz: 55b772e15f73150cabe04b305bae16be4f96e191
5
5
  SHA512:
6
- metadata.gz: a63c0e81a343b40e4caffa621cd1c2bffedd7378b434e37e7353d1436ebe2bae85bf1052b0838abbaf58809e00862c084bc8aa3d104283e329b17142de4e5703
7
- data.tar.gz: d79debb4869bf5957f1fa0ad868ec27825d939d39622cecedb40f2e17b831669357fad6e5c134a4536e8a9160c023a139436739a1b2fa04e3a9e2581ae0220f1
6
+ metadata.gz: 380f006895536971abdcfab69929b68129d6386844de590fefc9d1db3a50c92126169801212cf2fd10ce0d7f7475d7ee93680296c931168d7352ae2a88db1ef6
7
+ data.tar.gz: 8511f68a4efb29c74b150c7fa0d819f3f59554e8316903075bcf0cea16ba7db3859baf6bc5e321f4802d75af544be38043746dd8b31a7d4377f9c74e9688babe
data/lib/redis-stat.rb CHANGED
@@ -149,6 +149,7 @@ private
149
149
  RedisStat::Server.run!
150
150
  rescue Interrupt
151
151
  end
152
+ Thread.main.raise Interrupt
152
153
  }
153
154
  RedisStat::Server.wait_until_running
154
155
  trap('INT') { Thread.main.raise Interrupt }
@@ -164,6 +164,7 @@ var updateTable = function() {
164
164
  var row = "<tr class='hide'>"
165
165
  for (var i = 0; i < measures.length; ++i) {
166
166
  var m = measures[i]
167
+ if (!jd[m].hasOwnProperty(selected)) return
167
168
  row +=
168
169
  "<td class='" + colors[m] + "'>" +
169
170
  jd[m][selected][0] +
@@ -187,6 +188,13 @@ var updatePlot = function() {
187
188
  if (plot2 != undefined) plot2.destroy();
188
189
  if (plot3 != undefined) plot3.destroy();
189
190
 
191
+ var pluck = function(from) {
192
+ if (from.hasOwnProperty(selected))
193
+ return from[selected][1]
194
+ else
195
+ return 0
196
+ }
197
+
190
198
  // Chart
191
199
  if (hist.length > 0) {
192
200
  var offset = 1 - Math.min(max, hist.length)
@@ -194,25 +202,25 @@ var updatePlot = function() {
194
202
  // Commands/sec
195
203
  plot1 = $.jqplot('chart1', [
196
204
  hist.map(function(h, idx) {
197
- return [idx + offset, h.dynamic['total_commands_processed_per_second'][selected][1] ] })
205
+ return [idx + offset, pluck(h.dynamic['total_commands_processed_per_second']) ] })
198
206
  ], chart_options.chart1);
199
207
  plot1.replot();
200
208
 
201
209
  // CPU usage
202
210
  plot2 = $.jqplot('chart2', [
203
211
  hist.map(function(h, idx) {
204
- return [idx + offset, h.dynamic['used_cpu_user'][selected][1] ] }),
212
+ return [idx + offset, pluck(h.dynamic['used_cpu_user']) ] }),
205
213
  hist.map(function(h, idx) {
206
- return [idx + offset, h.dynamic['used_cpu_sys'][selected][1] ] }),
214
+ return [idx + offset, pluck(h.dynamic['used_cpu_sys']) ] }),
207
215
  ], chart_options.chart2);
208
216
  plot2.replot();
209
217
 
210
218
  // Memory status
211
219
  plot3 = $.jqplot('chart3', [
212
220
  hist.map(function(h, idx) {
213
- return [idx + offset, h.dynamic['used_memory'][selected][1] / 1024 / 1024 ] }),
221
+ return [idx + offset, pluck(h.dynamic['used_memory']) / 1024 / 1024 ] }),
214
222
  hist.map(function(h, idx) {
215
- return [idx + offset, h.dynamic['used_memory_rss'][selected][1] / 1024 / 1024 ] }),
223
+ return [idx + offset, pluck(h.dynamic['used_memory_rss']) / 1024 / 1024 ] }),
216
224
  ], chart_options.chart3);
217
225
  plot3.replot();
218
226
  } else {
@@ -132,15 +132,13 @@
132
132
 
133
133
  </div>
134
134
 
135
+ <a href="https://github.com/junegunn/redis-stat">
136
+ <img style="position: fixed; top: 0; right: 0; border: 0; z-index: 10000" src="/forkme.png" alt="Fork me on GitHub">
137
+ </a>
138
+
135
139
  <footer class="footer">
136
140
  <div class="container">
137
- <p>
138
- Powered by <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>,
139
- <a href="http://jquery.com/">jQuery</a>,
140
- <a href="https://github.com/ivaynberg/select2">select2</a>,
141
- and <a href="http://www.jqplot.com/">jqPlot</a>.
142
- Source code is hosted on <a href="https://github.com/junegunn/redis-stat">GitHub</a>.
143
- </p>
141
+ <p>Powered by <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>, <a href="http://jquery.com/">jQuery</a> and <a href="http://www.jqplot.com/">jqPlot</a>.</p>
144
142
  </div>
145
143
  </footer>
146
144
 
@@ -1,3 +1,3 @@
1
1
  class RedisStat
2
- VERSION = '0.4.7'
2
+ VERSION = '0.4.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Junegunn Choi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-10 00:00:00.000000000 Z
11
+ date: 2014-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi256
@@ -205,6 +205,7 @@ files:
205
205
  - lib/redis-stat/server/public/css/site.css
206
206
  - lib/redis-stat/server/public/favicon.ico
207
207
  - lib/redis-stat/server/public/favicon.png
208
+ - lib/redis-stat/server/public/forkme.png
208
209
  - lib/redis-stat/server/public/jqplot/jqplot.canvasAxisLabelRenderer.min.js
209
210
  - lib/redis-stat/server/public/jqplot/jqplot.canvasAxisTickRenderer.min.js
210
211
  - lib/redis-stat/server/public/jqplot/jqplot.canvasTextRenderer.min.js
@@ -240,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  version: '0'
241
242
  requirements: []
242
243
  rubyforge_project:
243
- rubygems_version: 2.2.2
244
+ rubygems_version: 2.4.2
244
245
  signing_key:
245
246
  specification_version: 4
246
247
  summary: A real-time Redis monitoring tool written in Ruby