impulse 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/impulse/version.rb +1 -1
  2. data/lib/impulse.rb +4 -3
  3. metadata +4 -4
@@ -1,3 +1,3 @@
1
1
  module Impulse
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/impulse.rb CHANGED
@@ -18,7 +18,8 @@ module Impulse
18
18
  :width => 600,
19
19
  :title => 'Impuse Graph',
20
20
  :vertical => '',
21
- :legend => ''
21
+ :legend => '',
22
+ :thickness => 1
22
23
  }.merge(params)
23
24
 
24
25
  defaults = "-E -W 'Generated at #{Time.at(Time.now)}' -e now -h #{params[:height]} -w #{params[:width]}"
@@ -29,12 +30,12 @@ module Impulse
29
30
  name.each do |k,v|
30
31
  v = { :color => '#FF0000', :data => :data }.merge(v)
31
32
  cmd << "DEF:d#{c}=#{v[:name]}.rrd:#{v[:data].to_s}:MAX"
32
- cmd << "LINE1:d#{c}#{v[:color]}:'#{k}' GPRINT:d#{c}:LAST:\"Last\\:%8.0lf\" GPRINT:d#{c}:MIN:\" Min\\:%8.0lf\" GPRINT:d#{c}:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:d#{c}:MAX:\" Max\\:%8.0lf\\n\""
33
+ cmd << "LINE#{params[:thickness]}:d#{c}#{v[:color]}:'#{k}' GPRINT:d#{c}:LAST:\"Last\\:%8.0lf\" GPRINT:d#{c}:MIN:\" Min\\:%8.0lf\" GPRINT:d#{c}:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:d#{c}:MAX:\" Max\\:%8.0lf\\n\""
33
34
  c += 1
34
35
  end
35
36
  else
36
37
  cmd << "DEF:average=#{name}.rrd:data:MAX"
37
- cmd << "LINE1:average#FF0000:'#{params[:legend]}' GPRINT:average:LAST:\"Last\\:%8.0lf\" GPRINT:average:MIN:\" Min\\:%8.0lf\" GPRINT:average:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:average:MAX:\" Max\\:%8.0lf\\n\""
38
+ cmd << "LINE#{params[:thickness]}:average#FF0000:'#{params[:legend]}' GPRINT:average:LAST:\"Last\\:%8.0lf\" GPRINT:average:MIN:\" Min\\:%8.0lf\" GPRINT:average:AVERAGE:\" Avg\\:%8.0lf\" GPRINT:average:MAX:\" Max\\:%8.0lf\\n\""
38
39
  end
39
40
 
40
41
  system cmd.join(" ")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impulse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lloyd Pick
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-09 00:00:00 Z
18
+ date: 2011-05-11 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Ability to make RRDTool graphs with zero thought