redis-stat 0.4.4 → 0.4.5

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: 7358eb33c6d85c07498b1c1f865ebdcafbd4b010
4
- data.tar.gz: 136cb4a3fbca30a77392a0c42d943664c6febddb
3
+ metadata.gz: 59be674e99aca3310df63dee432d655552d7bb7c
4
+ data.tar.gz: ba3e759c195ab8e8a91627d237413d0d329ecef7
5
5
  SHA512:
6
- metadata.gz: 6824e05c3653e752c284f047b6a0801180d922953c26a58a9c4771ce0ff22ebe6b064330e378752926c7825fcefbc6517ef2e79c0b4fe50ccb2ec26e559ae3c4
7
- data.tar.gz: a8c1334f366e67bb58b851064d7feed3c084d927ec2a08b249ddafd563ed2081adb20be46983b052608433928d19658b6af6cbff10069938175aac04dc638a73
6
+ metadata.gz: 6fd96b898434f2d679d71fb2b614f8b582faca0ce6f1eb60c04eb0bd3899cd94c8619abdde419a7a901da7517434b3b789f411f9785e6d17958bf5d4d0b6204f
7
+ data.tar.gz: a4715e12828c2415de84de9fd3164c2a4f862255608694fee69f50f5c96f5a09eeb94f453807ff52e72a5c86235736ea18e0d44894959e952d891e1b6b9ee80d
@@ -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
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
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: ruby
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