Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 5 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Jul 17, 2012
David Gillies added graph option logbase for setting a logarithmic scale 5a5d413
David Gillies fixed up spacing b019659
Commits on Aug 22, 2012
David Gillies Merge remote-tracking branch 'upstream/master'
Conflicts:
	lib/graphite_graph.rb
7aa7fc8
Commits on Aug 23, 2012
David Gillies Added nonNegativeDerivative, sum and keepLastValue 328f2ca
Commits on Sep 04, 2012
@ripienaar Merge pull request #21 from davewongillies/master
graph option logbase for setting a logarithmic scale
ed7a5c4
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/graphite_graph.rb
View
10 lib/graphite_graph.rb
@@ -48,6 +48,7 @@ def defaults
:major_grid_line_color => nil,
:minor_grid_line_color => nil,
:area => :none,
+ :logbase => nil,
:placeholders => nil}.merge(@overrides)
end
@@ -284,6 +285,7 @@ def url(format = nil, url=true)
url_parts << "bgcolor=#{properties[:background_color]}" if properties[:background_color]
url_parts << "fgcolor=#{properties[:foreground_color]}" if properties[:foreground_color]
url_parts << "vtitleRight=#{properties[:vtitle_right]}" if properties[:vtitle_right]
+ url_parts << "logBase=#{properties[:logbase]}" if properties[:logbase]
target_order.each do |name|
target = targets[name]
@@ -295,7 +297,13 @@ def url(format = nil, url=true)
graphite_target = target[:data]
- graphite_target = "derivative(#{graphite_target})" if target[:derivative]
+ graphite_target = "keepLastValue(#{graphite_target})" if target[:keep_last_value]
+ graphite_target = "sum(#{graphite_target})" if target[:sum]
+ if target[:derivative]
+ graphite_target = "derivative(#{graphite_target})"
+ elsif target[:non_negative_derivative]
+ graphite_target = "nonNegativeDerivative(#{graphite_target})"
+ end
graphite_target = "highestAverage(#{graphite_target},#{target[:highest_average]})" if target[:highest_average]
if target[:scale]
graphite_target = "scale(#{graphite_target},#{target[:scale]})"

No commit comments for this range

Something went wrong with that request. Please try again.