nightfury 0.8.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'redis', '~> 2.2.2'
4
- gem 'redis-namespace', '1.0.3'
3
+ gem 'redis'
4
+ gem 'redis-namespace'
5
5
  gem 'activesupport', '~> 3.0.0'
6
6
  gem 'i18n'
7
7
  gem 'json'
@@ -32,7 +32,7 @@ module Nightfury
32
32
  def decode_data_point(data_point)
33
33
  time, data_with_meta = super(data_point)
34
34
  current_count, current_total, data = data_with_meta.split(',')
35
- [data_point[1], data, {current_count: current_count, current_total: current_total}]
35
+ [data_point[1].to_i.to_s, data, {current_count: current_count, current_total: current_total}]
36
36
  end
37
37
  end
38
38
  end
@@ -36,14 +36,14 @@ module Nightfury
36
36
  if timestamp
37
37
  timestamp = get_step_time(timestamp).to_i
38
38
  data_point = redis.zrangebyscore(redis_key, 0, timestamp, withscores: true)
39
- data_point = data_point.each_slice(2).map {|pair| pair }.last
39
+ data_point = data_point.last
40
40
  else
41
41
  data_point = redis.zrevrange(redis_key, 0, 0, withscores: true)
42
- data_point = data_point.each_slice(2).map {|pair| pair }.last
42
+ data_point = data_point.last
43
43
  end
44
44
 
45
45
  return get_meta ? [nil, {}] : nil if data_point.nil?
46
- return get_meta ? [nil, {}] : nil if data_point[1] == "0"
46
+ return get_meta ? [nil, {}] : nil if data_point[1] == 0.0
47
47
 
48
48
  time, data, meta_value = decode_data_point(data_point)
49
49
  get_meta ? [{time => data}, meta_value] : {time => data}
@@ -53,7 +53,7 @@ module Nightfury
53
53
  return nil unless redis.exists(redis_key)
54
54
  timestamp = get_step_time(timestamp).to_i
55
55
  data_point = redis.zrangebyscore(redis_key, timestamp, timestamp, withscores: true)
56
- data_point = data_point.each_slice(2).map {|pair| pair }.last
56
+ data_point = data_point.last
57
57
  return get_meta ? [nil, {}] : nil if data_point.nil?
58
58
  time, data, meta_value = decode_data_point(data_point)
59
59
  result = get_meta ? [{time => data}, meta_value] : {time => data}
@@ -139,7 +139,7 @@ module Nightfury
139
139
  end
140
140
 
141
141
  def decode_many_data_points(data_points)
142
- data_points = data_points.each_slice(2).map {|pair| pair }
142
+ #data_points = data_points.each_slice(2).map {|pair| pair }
143
143
  result = {}
144
144
  data_points.each do |data_point|
145
145
  time, data = decode_data_point(data_point)
@@ -1,3 +1,3 @@
1
1
  module Nightfury
2
- VERSION = "0.8.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nightfury
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-11 00:00:00.000000000 Z
13
+ date: 2013-05-13 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Nightfury is a reporting/analytics backend written on Redis
16
16
  email: