594
edits
Changes
Vvs uploaded a new version of File:Kernel patches stats.png
== Description == This graph shows how many patches from OpenVZ developers were merged into mainstream Linux kernel, per each kernel version. It is done in drawn by gnuplot. Data using the data set produced by a simple shell script working on obtained from kernel git repository. == Source code ===== Collect data ===Here is the scriptto produce the data for the graph, called <code>count</code>:
<small><source lang="bash">
#!/bin/sh
# Return the date of the given tag, in a format usable by gnuplot
get_tag_date() {
}
done | sed 's/ /\t/g'
</source></small>
=== Draw the graph ===
Here is the script to produce the graph. Note it calls the previous script under the name 'count'.
<small><source lang="bash">
#!/bin/sh
REPO=~/git/linux/.git
COUNT=$(pwd)/count
OUT=$(pwd)/time.dat
export GDFONTPATH=/usr/share/fonts/microsoft
export GIT_DIR=$REPO
if test "$1" != "-f"; then
echo "== Previous (old) stats =="
tail -n 2 $OUT
# Update the repo and count new stats
(cd $REPO && cd .. && git pull) && sh $COUNT > $OUT
echo "== New stats =="
tail -n 2 $OUT
fi
DATE=$(tail -n 1 $OUT | cut -f 1 | awk -F- '{print $2,$1,$3}')
MAXY=$(awk 'BEGIN {max=0}; ($3 > max) {max=$3}; END {print max+80}' < time.dat)
# GNU date is powerful!
MAXX=$(date +%b-1-%Y --date='+2 months')
cat << EOF | gnuplot > plot.png
set terminal png enhanced font "verdana,13" size 1600,1200
set title "OpenVZ team kernel patches progress as of ${DATE}"
unset xlabel
set xdata time
set timefmt "%b-%d-%Y"
set format x "%b\n%Y"
set grid xtics mxtics noytics
set xrange [ : "${MAXX}" ]
set yrange [ 0 : ${MAXY} ]
set ylabel "Number of patches from OpenVZ team,\n per kernel release, accepted into mainstream"
set border 3 # no lines at right and top
set xtics nomirror # no tics at top
set ytics nomirror # no tics at right
plot '${OUT}' using 1:3 with linespoints pt 6 ps 1 lw 2 lt 2 notitle, \
'' using 1:3:2 with labels left offset 0,5.5 rotate notitle, \
'' using 1:3:3 with labels left offset 0.7,0 notitle
EOF
</source></small>