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.
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module CityWatch
2
- VERSION = "0.6.9"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: city-watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: