impulse 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +23 -0
- data/lib/impulse.rb +2 -1
- data/lib/impulse/version.rb +1 -1
- metadata +50 -28
data/README.rdoc
CHANGED
@@ -103,6 +103,29 @@ Default plot parameters for push()...
|
|
103
103
|
|
104
104
|
All can be configured on a per RRD basis.
|
105
105
|
|
106
|
+
== ADDITIONAL PARAMS:
|
107
|
+
|
108
|
+
You can pass additional parameters to imp.draw which will be passed along to the 'rrdtool graph' command without modification. Use this to overlay additional data if required. For example:
|
109
|
+
|
110
|
+
imp.draw(
|
111
|
+
{
|
112
|
+
'In' => { :name => "data_in_out", :data => :in, :color => '#000000' },
|
113
|
+
'Out' => { :name => "data_in_out", :data => :out },
|
114
|
+
'Requests' => { :name => "elb_eu_west" }
|
115
|
+
},
|
116
|
+
:hour,
|
117
|
+
{
|
118
|
+
:filename => 'data_in_out_elb.png',
|
119
|
+
:title => 'In/Out + ELB - Last Hour',
|
120
|
+
:vertical => 'Data'
|
121
|
+
}
|
122
|
+
'VRULE:1332421230#FF00FF:"An event"'
|
123
|
+
)
|
124
|
+
|
125
|
+
will result in a vertical line being overlayed at the specified timestamp, in the colour '#FF00FF' labelled as 'An event'. Separate multiple parameters with a space.
|
126
|
+
|
127
|
+
You will need to refer to the rrdtool graph documentation for the available commands you can use with this option.
|
128
|
+
|
106
129
|
== QUICK NOTE:
|
107
130
|
|
108
131
|
Yes, this is hacky as anything, it has no tests and does some stuff in a really bad way.
|
data/lib/impulse.rb
CHANGED
@@ -14,7 +14,7 @@ module Impulse
|
|
14
14
|
push_to_rrd(name, datas, params)
|
15
15
|
end
|
16
16
|
|
17
|
-
def draw(name, time_scale = :day, params = {})
|
17
|
+
def draw(name, time_scale = :day, params = {}, extra_params = nil)
|
18
18
|
params = {
|
19
19
|
:filename => 'impulse.png',
|
20
20
|
:rrd_path => '.',
|
@@ -60,6 +60,7 @@ module Impulse
|
|
60
60
|
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\""
|
61
61
|
end
|
62
62
|
|
63
|
+
cmd << extra_params unless extra_params.nil?
|
63
64
|
system cmd.join(" ")
|
64
65
|
end
|
65
66
|
|
data/lib/impulse/version.rb
CHANGED
metadata
CHANGED
@@ -1,34 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: impulse
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Lloyd Pick
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-03-22 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: rake
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
22
32
|
type: :development
|
23
|
-
|
24
|
-
version_requirements: *2164485860
|
33
|
+
version_requirements: *id001
|
25
34
|
description: Ability to make RRDTool graphs with zero thought
|
26
|
-
email:
|
35
|
+
email:
|
27
36
|
- lloyd.pick+impulse@forward.co.uk
|
28
37
|
executables: []
|
38
|
+
|
29
39
|
extensions: []
|
40
|
+
|
30
41
|
extra_rdoc_files: []
|
31
|
-
|
42
|
+
|
43
|
+
files:
|
32
44
|
- .gitignore
|
33
45
|
- Gemfile
|
34
46
|
- README.rdoc
|
@@ -38,26 +50,36 @@ files:
|
|
38
50
|
- lib/impulse/version.rb
|
39
51
|
homepage: https://github.com/forward/impulse
|
40
52
|
licenses: []
|
53
|
+
|
41
54
|
post_install_message:
|
42
55
|
rdoc_options: []
|
43
|
-
|
56
|
+
|
57
|
+
require_paths:
|
44
58
|
- lib
|
45
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
60
|
none: false
|
47
|
-
requirements:
|
48
|
-
- -
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
|
51
|
-
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
hash: 3
|
65
|
+
segments:
|
66
|
+
- 0
|
67
|
+
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
69
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
57
77
|
requirements: []
|
78
|
+
|
58
79
|
rubyforge_project: impulse
|
59
|
-
rubygems_version: 1.8.
|
80
|
+
rubygems_version: 1.8.15
|
60
81
|
signing_key:
|
61
82
|
specification_version: 3
|
62
83
|
summary: RubyGem to help make very quick RRDTool graphs
|
63
84
|
test_files: []
|
85
|
+
|