city-watch 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/city_watch/reader/watchman.rb +2 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
@@ -27,6 +27,7 @@ module Reader
|
|
27
27
|
def sparkline_image_tags
|
28
28
|
data_sets.map do |set|
|
29
29
|
dat = get_data_set(set)
|
30
|
+
puts dat.inspect
|
30
31
|
[set.to_sym, dat.length > 1 ? sparkline_img_tag(dat.map {|(tm,val)| val }, set) : nil]
|
31
32
|
end.select {|(name,tag)| !tag.nil? }
|
32
33
|
end
|
@@ -34,7 +35,7 @@ module Reader
|
|
34
35
|
def get_data_set(data_set_name,s_time=(Time.now - (60*60*4)),e_time=Time.now)
|
35
36
|
CityWatch.redis.zrevrangebyscore(data_set_key(data_set_name), e_time.to_i, s_time.to_i, :with_scores => true).map do |(val,score)|
|
36
37
|
timestamp,value = val.split(",")
|
37
|
-
[Time.at(timestamp.to_i), Float(value)]
|
38
|
+
[Time.at(timestamp.to_i), Float(value).to_i]
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
data/lib/version.rb
CHANGED