graphite_graph 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,7 @@ class GraphiteGraph
23
23
  def defaults
24
24
  @properties = {:title => nil,
25
25
  :vtitle => nil,
26
+ :vtitle_right => nil,
26
27
  :width => 500,
27
28
  :height => 250,
28
29
  :from => "-1hour",
@@ -47,6 +48,7 @@ class GraphiteGraph
47
48
  :major_grid_line_color => nil,
48
49
  :minor_grid_line_color => nil,
49
50
  :area => :none,
51
+ :logbase => nil,
50
52
  :placeholders => nil}.merge(@overrides)
51
53
  end
52
54
 
@@ -234,6 +236,7 @@ class GraphiteGraph
234
236
  args = {:data => "threshold(#{options[:value]})", :color => options[:color], :alias => options[:alias]}
235
237
 
236
238
  args[:dashed] = true if options[:dashed]
239
+ args[:second_y_axis] = true if options[:second_y_axis]
237
240
 
238
241
  field "line_#{@linecount}", args
239
242
 
@@ -282,6 +285,8 @@ class GraphiteGraph
282
285
  url_parts << "minorGridLineColor=#{properties[:minor_grid_line_color]}" if properties[:minor_grid_line_color]
283
286
  url_parts << "bgcolor=#{properties[:background_color]}" if properties[:background_color]
284
287
  url_parts << "fgcolor=#{properties[:foreground_color]}" if properties[:foreground_color]
288
+ url_parts << "vtitleRight=#{properties[:vtitle_right]}" if properties[:vtitle_right]
289
+ url_parts << "logBase=#{properties[:logbase]}" if properties[:logbase]
285
290
 
286
291
  target_order.each do |name|
287
292
  target = targets[name]
@@ -293,7 +298,13 @@ class GraphiteGraph
293
298
 
294
299
  graphite_target = target[:data]
295
300
 
296
- graphite_target = "derivative(#{graphite_target})" if target[:derivative]
301
+ graphite_target = "keepLastValue(#{graphite_target})" if target[:keep_last_value]
302
+ graphite_target = "sum(#{graphite_target})" if target[:sum]
303
+ if target[:derivative]
304
+ graphite_target = "derivative(#{graphite_target})"
305
+ elsif target[:non_negative_derivative]
306
+ graphite_target = "nonNegativeDerivative(#{graphite_target})"
307
+ end
297
308
  graphite_target = "highestAverage(#{graphite_target},#{target[:highest_average]})" if target[:highest_average]
298
309
  if target[:scale]
299
310
  graphite_target = "scale(#{graphite_target},#{target[:scale]})"
@@ -1,3 +1,3 @@
1
1
  class GraphiteGraph
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphite_graph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-07-16 00:00:00 +01:00
19
+ date: 2012-09-21 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies: []
22
22