Index: work/chgstat_graph/events =================================================================== --- work/chgstat_graph/events (nonexistent) +++ work/chgstat_graph/events (revision 12896) @@ -0,0 +1,9 @@ +2015-08-01 gpmi import +2016-02-23 ungib start +2016-04-23 conf rewrite start +2016-07-10 I/O effort start: kicad +2016-09-01 lihata +2017-02-10 toporouter removal +2017-06-01 subc +2017-10-14 padstacks + Index: work/chgstat_graph/plot.sh =================================================================== --- work/chgstat_graph/plot.sh (revision 12895) +++ work/chgstat_graph/plot.sh (revision 12896) @@ -3,15 +3,19 @@ awk ' BEGIN { dt = 0 + print "set term \"png\" size 1024,768" > "plot1" + print "set term \"png\" size 1024,768" > "plot2" print "set format x \"\"" > "plot1" print "set format x \"\"" > "plot2" print "set xlabel \"\"" > "plot1" print "set xlabel \"\"" > "plot2" - print "set ylabel \"lines of code\"" > "plot1" - print "set ylabel \"%\"" > "plot2" - print "set yrange [0:300000]" > "plot1" + print "set ylabel \"lines of code changed\"" > "plot1" + print "set ylabel \"code change stats [%]\"" > "plot2" + print "set yrange [0:350000]" > "plot1" print "set yrange [0:100]" > "plot2" } + + /^20..-/ { getline old getline new @@ -18,14 +22,16 @@ getline perc sub("^old: *", "", old) sub("^new: *", "", new) - print old > "data.old" - print new > "data.new" - print old+new > "data.total" - print perc > "data.perc" + print old > "code.old" + print new > "code.new" + print old+new > "code.total" + print perc > "code.perc" + split($1, A, "-") + when=A[1] "-" sprintf("%02d", A[2]) + DT[when] = dt + if (dt % 4 == 0) { - split($1, A, "-") - when=A[1] "-" sprintf("%02d", A[2]) print "set label \"" when "\" at " dt ",0 rotate right" > "plot1" print "set label \"" when "\" at " dt ",0 rotate right" > "plot2" } @@ -33,11 +39,28 @@ } END { + while((getline < "events") == 1) { + ev = $0 + sub("^" $1 " *", "", ev) + split($1, A, "-") + when=A[1] "-" sprintf("%02d", A[2]) + dt = DT[when] + A[2] / 31 + print "set arrow from " dt ",0 to " dt ",300000 nohead" > "plot1" + print "set label \"" ev "\" at " dt-0.7 ",300000 rotate right" > "plot1" + + print "set arrow from " dt ",0 to " dt ",88 nohead" > "plot2" + print "set label \"" ev "\" at " dt-0.7 ",85 rotate right" > "plot2" + } + } + + END { print "set bmargin 6" > "plot1" print "set bmargin 6" > "plot2" - print "plot \"data.total\" with filledcurve x1, \"data.new\" with filledcurve x1;" > "plot1" - print "plot \"data.perc\" with lines" > "plot2" + print "plot \"code.total\" with filledcurve x1, \"code.new\" with filledcurve x1;" > "plot1" + print "plot \"code.perc\" with lines" > "plot2" } ' < log +gnuplot < plot1 > plot1.png +gnuplot < plot2 > plot2.png