redis-stat 0.4.2 → 0.4.3
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 +4 -4
- data/README.md +2 -1
- data/lib/redis-stat/option.rb +1 -1
- data/lib/redis-stat/server/public/js/site.js +12 -12
- data/lib/redis-stat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30d9a13b1fb84a716edfdfb8d6b531dec468f823
|
4
|
+
data.tar.gz: bf10d40aba6f7c8d944b2a87877840c6c6321d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de97452107da1449a8fc1e42ce28bbc87ce22d00baac4ba9da476c319ddee3ea2095b6c4236acfe54c8e3c3d03f34bbc54c197504b6f463cdc025689cf959c35
|
7
|
+
data.tar.gz: a168cf85734968db5c9314bcd1544eca454ca652a113a63fdca1e3e78e5adaf713aadf9ad3af85548a166d17b5ad1543b9171b3000bcf2ffc3fa50a15c70f4ae
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ usage: redis-stat [HOST[:PORT] ...] [INTERVAL [COUNT]]
|
|
26
26
|
--style=STYLE Output style: unicode|ascii
|
27
27
|
--no-color Suppress ANSI color codes
|
28
28
|
--csv=OUTPUT_CSV_FILE_PATH Save the result in CSV format
|
29
|
-
--es=ELASTICSEARCH_URL Send results to
|
29
|
+
--es=ELASTICSEARCH_URL Send results to ElasticSearch: [http://]HOST[:PORT][/INDEX]
|
30
30
|
|
31
31
|
--server[=PORT] Launch redis-stat web server (default port: 63790)
|
32
32
|
--daemon Daemonize redis-stat. Must be used with --server option.
|
@@ -86,6 +86,7 @@ printed as they are not supported in the default Windows command prompt.
|
|
86
86
|
## Contributors
|
87
87
|
- [Chris Meisl](https://github.com/cmeisl)
|
88
88
|
- [Hyunseok Hwang](https://github.com/frhwang)
|
89
|
+
- [Sent Hil](https://github.com/sent-hil)
|
89
90
|
|
90
91
|
## Contributing
|
91
92
|
|
data/lib/redis-stat/option.rb
CHANGED
@@ -38,7 +38,7 @@ module Option
|
|
38
38
|
options[:csv] = v
|
39
39
|
end
|
40
40
|
|
41
|
-
opts.on('--es=ELASTICSEARCH_URL', 'Send results to
|
41
|
+
opts.on('--es=ELASTICSEARCH_URL', 'Send results to ElasticSearch: [http://]HOST[:PORT][/INDEX]') do |v|
|
42
42
|
options[:es] = RedisStat::ElasticsearchSink.parse_url v
|
43
43
|
end
|
44
44
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var
|
1
|
+
var hist = [],
|
2
2
|
max,
|
3
3
|
rows,
|
4
4
|
measures,
|
@@ -134,9 +134,9 @@ var initialize = function(params) {
|
|
134
134
|
}
|
135
135
|
|
136
136
|
var appendToHistory = function(json) {
|
137
|
-
if (
|
138
|
-
|
139
|
-
if (
|
137
|
+
if (hist.length == 0 || json.at > hist[ hist.length - 1 ].at) {
|
138
|
+
hist.push(json)
|
139
|
+
if (hist.length > max) hist.shift()
|
140
140
|
return true
|
141
141
|
} else {
|
142
142
|
return false
|
@@ -144,7 +144,7 @@ var appendToHistory = function(json) {
|
|
144
144
|
}
|
145
145
|
|
146
146
|
var updateTable = function() {
|
147
|
-
var json =
|
147
|
+
var json = hist[ hist.length - 1 ],
|
148
148
|
js = json.static,
|
149
149
|
jd = json.dynamic
|
150
150
|
|
@@ -185,30 +185,30 @@ var updatePlot = function() {
|
|
185
185
|
if (plot3 != undefined) plot3.destroy();
|
186
186
|
|
187
187
|
// Chart
|
188
|
-
if (
|
189
|
-
var offset = 1 - Math.min(max,
|
188
|
+
if (hist.length > 0) {
|
189
|
+
var offset = 1 - Math.min(max, hist.length)
|
190
190
|
|
191
191
|
// Commands/sec
|
192
192
|
plot1 = $.jqplot('chart1', [
|
193
|
-
|
193
|
+
hist.map(function(h, idx) {
|
194
194
|
return [idx + offset, h.dynamic['total_commands_processed_per_second'][1] ] })
|
195
195
|
], chart_options.chart1);
|
196
196
|
plot1.replot();
|
197
197
|
|
198
198
|
// CPU usage
|
199
199
|
plot2 = $.jqplot('chart2', [
|
200
|
-
|
200
|
+
hist.map(function(h, idx) {
|
201
201
|
return [idx + offset, h.dynamic['used_cpu_user'][1] ] }),
|
202
|
-
|
202
|
+
hist.map(function(h, idx) {
|
203
203
|
return [idx + offset, h.dynamic['used_cpu_sys'][1] ] }),
|
204
204
|
], chart_options.chart2);
|
205
205
|
plot2.replot();
|
206
206
|
|
207
207
|
// Memory status
|
208
208
|
plot3 = $.jqplot('chart3', [
|
209
|
-
|
209
|
+
hist.map(function(h, idx) {
|
210
210
|
return [idx + offset, h.dynamic['used_memory'][1] / 1024 / 1024 ] }),
|
211
|
-
|
211
|
+
hist.map(function(h, idx) {
|
212
212
|
return [idx + offset, h.dynamic['used_memory_rss'][1] / 1024 / 1024 ] }),
|
213
213
|
], chart_options.chart3);
|
214
214
|
plot3.replot();
|
data/lib/redis-stat/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.3
|
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-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi256
|