redis-stat 0.4.4-java → 0.4.5-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8141fc0b8abb82ab7927fd3dcd1b9b9264088ec2
4
- data.tar.gz: f52fbc1e912d769910eb39c3c00c654c0b6c5010
3
+ metadata.gz: adb9dfe1b8c9d7f87d7a00e92b0c4de2a24fb98d
4
+ data.tar.gz: 181778c3d1c79e470a99b2c0e6f07787a45b56b0
5
5
  SHA512:
6
- metadata.gz: 9fc14d060c405e106292085b02db992be984a493142757676ea3659cff0c7b2965aa86f924c7c8cb9f36bacce32834d1aeb1ce801477d258196bd22ce0ca6964
7
- data.tar.gz: 941a314949a1809b19cb251ec0292451ccc639e608b857427a410e3fe341c8a9bf51b429a1f870069f085a640f6c9028b4b6ebcfeb80f8a7a87b82197d0182c1
6
+ metadata.gz: 3184422eb7d8f9446838c98dc4ef7550dbdd7a9ff8ff22516373a59a08eebeb79a563e0eccac9e49a4b1d770cffeec4171b29d4eecea6aaafa3a00b99f4dc56a
7
+ data.tar.gz: 6b0fb63b87d5877248da3ea1514b02a27ecf3fafb925b484e8b0f1c534222f54e864db26d8805958b06544315b7278c7ff709d09c05d810d01c755c8fad4c3e7
data/lib/redis-stat.rb CHANGED
@@ -27,12 +27,14 @@ class RedisStat
27
27
  options[:style] = :ascii if windows
28
28
 
29
29
  @hosts = options[:hosts]
30
+ @interval = options[:interval]
30
31
  @redises = @hosts.inject({}) { |hash, e|
31
32
  host, port = e.split(':')
32
- hash[e] = Redis.new(Hash[ {:host => host, :port => port, :timeout => DEFAULT_REDIS_TIMEOUT}.select { |k, v| v } ])
33
+ hash[e] = Redis.new(Hash[ {:host => host,
34
+ :port => port,
35
+ :timeout => @interval}.select { |k, v| v } ])
33
36
  hash
34
37
  }
35
- @interval = options[:interval]
36
38
  @max_count = options[:count]
37
39
  @colors = options[:colors] || COLORS
38
40
  @csv = options[:csv]
@@ -391,7 +393,7 @@ private
391
393
 
392
394
  get_diff = lambda do |label|
393
395
  if dur && dur > 0
394
- (info.f(host, label) - prev_info.f(host, label)) / dur
396
+ [(info.f(host, label) - prev_info.f(host, label)) / dur, 0].max
395
397
  else
396
398
  nil
397
399
  end
@@ -2,7 +2,6 @@ class RedisStat
2
2
  DEFAULT_TERM_WIDTH = 180
3
3
  DEFAULT_TERM_HEIGHT = 25
4
4
  DEFAULT_SERVER_PORT = 63790
5
- DEFAULT_REDIS_TIMEOUT = 30
6
5
 
7
6
  MEASURES = {
8
7
  :static => [
@@ -1,3 +1,3 @@
1
1
  class RedisStat
2
- VERSION = "0.4.4"
2
+ VERSION = '0.4.5'
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.4
4
+ version: 0.4.5
5
5
  platform: java
6
6
  authors:
7
7
  - Junegunn Choi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi256