version 1.1, 2002/01/07 22:12:59
|
version 1.2, 2002/01/08 00:01:22
|
Line 69 statpage:
|
Line 69 statpage:
|
echo '<h1>LON-CAPA Coding Metrics</h1>' >> $(STATSUBDIR)/index.html |
echo '<h1>LON-CAPA Coding Metrics</h1>' >> $(STATSUBDIR)/index.html |
echo '<br />Compiled as of ' >> $(STATSUBDIR)/index.html |
echo '<br />Compiled as of ' >> $(STATSUBDIR)/index.html |
date >> $(STATSUBDIR)/index.html |
date >> $(STATSUBDIR)/index.html |
echo '<p> </p>' |
echo "<p>The general algorithm for counting lines of code (this excludes blank lines) is <blockquote>cvs -q diff -D'start-date' -D'end-date' -b -B -N | egrep '^> .*[^ \t]' | sed 's/^> //g' | sort | uniq | wc -l</blockquote> </p>" >> $(STATSUBDIR)/index.html |
echo '<br />Lines of Code; unique changes per month' >> $(STATSUBDIR)/index.html |
echo "<p>The general algorithm for counting the number of CVS repository commits (includes additions, deletions, and modifications) is: <blockquote>cvs history -D'start-date' -a -xMAR | wc -l</blockquote> </p>" >> $(STATSUBDIR)/index.html |
echo '<br />Lines of Code; unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html |
echo "<p>Each listing contains two graphs. One graph relates to the entire LON-CAPA repository. The other graph relates solely to the *.pm files (perl modules including Apache handlers).</p>" >> $(STATSUBDIR)/index.html |
echo '<br />Lines of Code; aggregating sum of unique changes per month' >> $(STATSUBDIR)/index.html |
echo '<br /><a href="#loc">Lines of Code; unique changes per month</a>' >> $(STATSUBDIR)/index.html |
echo '<br />Lines of Code; aggregating sum of unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html |
echo '<br /><a href="#locsum">Lines of Code; aggregate sum of unique changes per month</a>' >> $(STATSUBDIR)/index.html |
echo '<br />Number of commits to software repository per month' >> $(STATSUBDIR)/index.html |
echo '<br /><a href="#commit">Number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html |
echo '<br />Number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html |
echo '<br /><a href="#commitsum">Aggregate sum of number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html |
echo '<br />Aggregating sum of number of commits to software repository per month' >> $(STATSUBDIR)/index.html |
echo '<hr /><a name="loc"><h3>Lines of Code</h3>' >> $(STATSUBDIR)/index.html |
echo '<br />Aggregating sum of number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html |
echo 'The first graph displays the number of unique line changes made in the CVS repository per month. The second graphs displays the number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="loc.png" alt="lines of code" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="loc.png" alt="lines of code" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locpm.png" alt="lines of code, perl modules" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locpm.png" alt="lines of code, perl modules" />' >> $(STATSUBDIR)/index.html |
|
echo '<hr /><a name="locsum"><h3>Aggregate Lines of Code</h3>' >> $(STATSUBDIR)/index.html |
|
echo 'The first graph displays the aggregate number of unique line changes made in the CVS repository per month. The second graphs displays the aggregate number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locsum.png" alt="aggregate lines of code" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locsum.png" alt="aggregate lines of code" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locpmsum.png" alt="aggregate lines of code, perl modules" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="locpmsum.png" alt="aggregate lines of code, perl modules" />' >> $(STATSUBDIR)/index.html |
|
echo '<hr /><a name="commit"><h3>Commits to Repository</h3>' >> $(STATSUBDIR)/index.html |
|
echo 'The first graph displays the number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commit.png" alt="number of commits" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commit.png" alt="number of commits" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitpm.png" alt="number of commits, perl modules" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitpm.png" alt="number of commits, perl modules" />' >> $(STATSUBDIR)/index.html |
|
echo '<hr /><a name="commitsum"><h3>Aggregate Commits to Repository</h3>' >> $(STATSUBDIR)/index.html |
|
echo 'The first graph displays the aggregate number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the aggregate number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitsum.png" alt="aggregate number of commits" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitsum.png" alt="aggregate number of commits" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitpmsum.png" alt="aggregate number of commits, perl modules" />' >> $(STATSUBDIR)/index.html |
echo '<br /><img src="commitpmsum.png" alt="aggregate number of commits, perl modules" />' >> $(STATSUBDIR)/index.html |
echo '</body>' >> $(STATSUBDIR)/index.html |
echo '</body>' >> $(STATSUBDIR)/index.html |
Line 107 for ($$y=$$by; $$y<=$$ey; $$y++) {\
|
Line 113 for ($$y=$$by; $$y<=$$ey; $$y++) {\
|
}' 20000101 `date +"%Y%m%d"` |\ |
}' 20000101 `date +"%Y%m%d"` |\ |
perl -nle '($$d1,$$d2)=split(/\t/);$$loc=`cvs -q diff -D$$d1 -D$$d2 -b -B -N | egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/table.txt |
perl -nle '($$d1,$$d2)=split(/\t/);$$loc=`cvs -q diff -D$$d1 -D$$d2 -b -B -N | egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/table.txt |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/loc.png"\nset term png color\nplot "cvsstats/table.txt" using 1:2 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/loc.png"\nset term png color\nplot "cvsstats/table.txt" using 1:2 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nAggregate count; Unique changes per month"\nset output "cvsstats/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot |
cd ../..; perl -e ' \ |
cd ../..; perl -e ' \ |
($$begindate,$$enddate)=@ARGV;\ |
($$begindate,$$enddate)=@ARGV;\ |
($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
Line 125 perl -e "\@flag=(1);while(<>){if (/RCS f
|
Line 131 perl -e "\@flag=(1);while(<>){if (/RCS f
|
egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt |
egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt |
# process counts, generate table |
# process counts, generate table |
# pass table to gnuplot |
# pass table to gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nUnique changes per month"\nset output "cvsstats/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot |
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nAggregate count; Unique changes per month"\nset output "cvsstats/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot |
|
|
cvscommit: |
cvscommit: |
|
install -d cvsstats |
# for all, and for .pm |
# for all, and for .pm |
# get date array |
# get date array |
# process counts, generate table |
cd ../..; perl -e ' \ |
|
($$begindate,$$enddate)=@ARGV;\ |
|
($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
|
($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
|
for ($$y=$$by; $$y<=$$ey; $$y++) {\ |
|
if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\ |
|
if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\ |
|
for ($$m; $$m<=$$m2; $$m++) {\ |
|
printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \ |
|
$$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\ |
|
}\ |
|
}' 20000101 `date +"%Y%m%d"` |\ |
|
perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctable.txt |
|
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commit.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:2 with lines' | gnuplot |
|
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\nAggregate count (Additions, Deletions, and Modifications"\nset output "cvsstats/commitsum.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:3 with lines' | gnuplot |
|
cd ../..; perl -e ' \ |
|
($$begindate,$$enddate)=@ARGV;\ |
|
($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
|
($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\ |
|
for ($$y=$$by; $$y<=$$ey; $$y++) {\ |
|
if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\ |
|
if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\ |
|
for ($$m; $$m<=$$m2; $$m++) {\ |
|
printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \ |
|
$$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\ |
|
}\ |
|
}' 20000101 `date +"%Y%m%d"` |\ |
|
perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctablepm.txt |
|
# process counts, generate table |
# pass table to gnuplot |
# pass table to gnuplot |
|
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpm.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:2 with lines' | gnuplot |
|
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\nAggregate count (Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpmsum.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:3 with lines' | gnuplot |
|
|
clean: |
clean: |
rm -Rf cvsstats |
rm -Rf cvsstats |