Skip to content

Commit

Permalink
fix rrdtool argument bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Jan 21, 2014
1 parent 26d710a commit dd1b0fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/focuslight/rrd.rb
Expand Up @@ -146,7 +146,7 @@ def calc_period(span, from, to)
period = -1 * 4 * 60 * 60
xgrid = 'MINUTE:30:HOUR:1:MINUTE:30:0:%H:%M'
else # 'd' or 'sd' ?
period_title = (span == 'sd' ? 'Day (5min avg)' : 'Day (1min avg)')
period_title = (span == 'sd' ? 'Day (1min avg)' : 'Day (5min avg)')
period = -1 * 60 * 60 * 33 # 33 hours
xgrid = 'HOUR:1:HOUR:2:HOUR:2:0:%H'
end
Expand Down Expand Up @@ -177,7 +177,7 @@ def graph(datas, args)
'-a', 'PNG',
'-l', 0, #minimum
'-u', 2, #maximum
'-x', args[:xgrid] || xgrid,
'-x', (args[:xgrid].empty? ? xgrid : args[:xgrid]),
'-s', period,
'-e', period_end,
'--slope-mode',
Expand All @@ -191,7 +191,7 @@ def graph(datas, args)
'--color', 'SHADEB#' + args[:shadeb_color].to_s.upcase,
'--border', args[:border].to_s.upcase
]
rrdoptions.push('-y', args[:ygrid]) if args[:ygrid]
rrdoptions.push('-y', args[:ygrid]) unless args[:ygrid].empty?
rrdoptions.push('-t', period_title.to_s.dup) unless args[:notitle]
rrdoptions.push('--no-legend') unless args[:legend]
rrdoptions.push('--only-graph') if args[:graphonly]
Expand Down

0 comments on commit dd1b0fc

Please sign in to comment.