diff --git a/plot.rb b/plot.rb index a871d45..8b3a8a7 100644 --- a/plot.rb +++ b/plot.rb @@ -1,12 +1,14 @@ # coding: utf-8 users = ["christoffermadsen","jmaa","jacob","alexander"] colors = {} + users.each do |user| colors[user] = "%06x" % (rand * 0xffffff) end log_dir = "./log/" -plotstring = %Q[set terminal 'svg' size 800,400 -set key bottom outside +plotstring = %Q[set terminal 'svg' size 800,400 fname 'Verdana, Helvetica, Arial, sans-serif' \ +fsize '14' rounded dashed +set key top left outside set style line 1 lt 1 lw 2 pt 7 ps 0.4 @@ -14,7 +16,8 @@ set xlabel "Time" set xdata time set timefmt "%s" set format x "%m/%d" -set xtics 172800 +set xtics 60*60*24 +set xrange [1485275000:] set mxtics 2 set grid ytics mytics xtics mxtics @@ -49,3 +52,5 @@ end output = File.open("plotscript","w") output << plotstring output.close + +`gnuplot plotscript` diff --git a/update.rb b/update.rb index 07290a1..532470b 100644 --- a/update.rb +++ b/update.rb @@ -8,6 +8,7 @@ users.each do |user| [size,count].each do |x| x.delete! "\n" end + output = File.open("#{log_dir}/#{user}.log","a") output << "#{Time.now.to_i} #{count} #{size}\n" output.close