Skip to content

Commit

Permalink
Adds aliasByNode Function and highestAverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Fronius committed Feb 23, 2012
1 parent cc716f5 commit 024fe61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/graphite_graph.rb
Expand Up @@ -281,6 +281,7 @@ def url(format = nil, url=true)
graphite_target = target[:data]

graphite_target = "derivative(#{graphite_target})" if target[:derivative]
graphite_target = "highestAverage(#{graphite_target}),#{target[:highestAverage]})" if target[:highestAverage]
graphite_target = "scale(#{graphite_target},#{target[:scale]})" if target[:scale]
graphite_target = "drawAsInfinite(#{graphite_target})" if target[:line]
graphite_target = "movingAverage(#{graphite_target},#{target[:smoothing]})" if target[:smoothing]
Expand All @@ -290,7 +291,9 @@ def url(format = nil, url=true)
graphite_target = "secondYAxis(#{graphite_target})" if target[:second_y_axis]

unless target.include?(:subgroup)
if target[:alias]
if target[:aliasByNode]
graphite_target = "aliasByNode(#{graphite_target},#{target[:aliasByNode]})"
elsif target[:alias]
graphite_target = "alias(#{graphite_target},\"#{target[:alias]}\")"
else
graphite_target = "alias(#{graphite_target},\"#{name.to_s.capitalize}\")"
Expand Down

0 comments on commit 024fe61

Please sign in to comment.