city-watch 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/city_watch/reader/watchman.rb +3 -3
- data/lib/version.rb +1 -1
- metadata +1 -1
@@ -28,7 +28,7 @@ module Reader
|
|
28
28
|
data_sets.map do |set|
|
29
29
|
dat = get_data_set(set)
|
30
30
|
puts dat.inspect
|
31
|
-
[set.to_sym, dat.length > 1 ? sparkline_img_tag(dat.map {|(tm,val)| val }, set) : nil]
|
31
|
+
[set.to_sym, dat.length > 1 ? sparkline_img_tag(dat.map {|(tm,val)| val }, "#{set}") : nil]
|
32
32
|
end.select {|(name,tag)| !tag.nil? }
|
33
33
|
end
|
34
34
|
|
@@ -36,7 +36,7 @@ module Reader
|
|
36
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)|
|
37
37
|
timestamp,value = val.split(",")
|
38
38
|
[Time.at(timestamp.to_i), Float(value).to_i]
|
39
|
-
end
|
39
|
+
end.reverse
|
40
40
|
end
|
41
41
|
|
42
42
|
def data_set_key(data_set)
|
@@ -58,7 +58,7 @@ module Reader
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def sparkline_img_tag(dat,alt="")
|
61
|
-
"<img src=\"data:image/png;base64,#{sparkline(dat)}\" alt=\"#{alt}\" title=\"#{alt}\"/>"
|
61
|
+
"<img src=\"data:image/png;base64,#{sparkline(dat)}\" alt=\"#{alt}\" title=\"#{alt} max: #{dat.max} min: #{dat.min}\"/>"
|
62
62
|
end
|
63
63
|
|
64
64
|
def key(more)
|
data/lib/version.rb
CHANGED