LoginSignup
1
0

More than 5 years have passed since last update.

focuslightを使ってみた

Last updated at Posted at 2014-01-21

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

でインストール,起動します

起動後

とりあえずデータを投げたら
スクリーンショット 2014-01-21 20.54.58.png
が出ますので少し修正

すでに修正されています

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詳しい人…

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0