logtrend 0.3.20101204155928 → 0.4.20101204161637

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.
@@ -37,7 +37,11 @@ class LogTrend
37
37
  def build_graph(graphs_dir, rrd_dir, graph)
38
38
  RRD.graph File.join(graphs_dir,"#{graph.name}.png"), :title => graph.name, :width => 800, :height => 250, :color => ["FONT#000000", "BACK#FFFFFF"] do
39
39
  graph.points.each do |point|
40
- line File.join(rrd_dir,"#{point[:name]}.rrd"), "#{point[:name]}_count" => :average, :color => point[:color], :label => point[:name].to_s
40
+ if point[:style] == :line
41
+ line File.join(rrd_dir,"#{point[:name]}.rrd"), "#{point[:name]}_count" => :average, :color => point[:color], :label => point[:name].to_s
42
+ elsif point[:style] == :area
43
+ area File.join(rrd_dir,"#{point[:name]}.rrd"), "#{point[:name]}_count" => :average, :color => point[:color], :label => point[:name].to_s
44
+ end
41
45
  end
42
46
  end
43
47
  end
@@ -97,7 +101,7 @@ class Graph
97
101
  @points = []
98
102
  end
99
103
 
100
- def add_line(name,color)
101
- @points << {:name => name, :color => color}
104
+ def add_point(style,name,color)
105
+ @points << {:style => style, :name => name, :color => color}
102
106
  end
103
107
  end
@@ -15,8 +15,8 @@ LogTrend.start('test.log', "/tmp/rrd", "/tmp/graphs") do |l|
15
15
  l.add_trend(:kod) {|line| line.match /kilnhg.com/}
16
16
 
17
17
  l.add_graph(:requests_per_minute) do |g|
18
- g.add_line :fbod, "#0066cc"
19
- g.add_line :kod, "#993333"
18
+ g.add_point :area, :fbod, "#0066cc"
19
+ g.add_point :area, :kod, "#993333"
20
20
  end
21
21
 
22
22
  end
@@ -20,3 +20,10 @@ kilnhg.com
20
20
  test
21
21
  test
22
22
  test
23
+ test
24
+ test
25
+ test
26
+ test
27
+ test
28
+ test
29
+ test
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtrend
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40202408311843
4
+ hash: 40202408323269
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 20101204155928
10
- version: 0.3.20101204155928
8
+ - 4
9
+ - 20101204161637
10
+ version: 0.4.20101204161637
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Gorsuch