focuslightを使ってみた
3012 ワード
growthforecastのRubyクローンのfocuslightがリリースされたので使ってみました.
インストール
$ git clone git://github.com/tagomoris/focuslight.git
$ cd focuslight
$ bundle install
$ unicorn -E production -p 5125
$ mkdir data
$ bundle exec rake init
$ bundle exec rake short
$ git clone git://github.com/tagomoris/focuslight.git
$ cd focuslight
$ bundle install
$ unicorn -E production -p 5125
$ mkdir data
$ bundle exec rake init
$ bundle exec rake short
でインストール,起動します
起動後
すでに修正されています
diff --git a/lib/focuslight/rrd.rb b/lib/focuslight/rrd.rb
index 0badc40..69209bd 100644
--- a/lib/focuslight/rrd.rb
+++ b/lib/focuslight/rrd.rb
@@ -170,6 +170,7 @@ class Focuslight::RRD
end
tmpfile = Tempfile.new(["", ".png"]) # [basename_prefix, suffix]
+ args[:xgrid] = args[:xgrid].empty? ? xgrid : args[:xgrid]
rrdoptions = [
tmpfile.path,
'-w', width,
@@ -177,7 +178,7 @@ class Focuslight::RRD
'-a', 'PNG',
'-l', 0, #minimum
'-u', 2, #maximum
- '-x', args[:xgrid] || xgrid,
+ '-x', xgrid,
'-s', period,
'-e', period_end,
'--slope-mode',
@@ -191,7 +192,7 @@ class Focuslight::RRD
'--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]
でアクセスすると…
RuntimeError - RRDtool returns error to draw graph, error: Legend set but no color:
うん…誰かRRDtool詳しい人…
Author And Source
この問題について(focuslightを使ってみた), 我々は、より多くの情報をここで見つけました https://qiita.com/katsyoshi/items/57f6a4812e476d1e90ff著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .