diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-03-08 18:56:01 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-04-18 01:57:19 +0200 |
commit | 7a9d86b686a0d57abf68635bbc758b9d097d7fbd (patch) | |
tree | dc3565fce02ada8cba43cd592c1e432c20499fff | |
parent | 977271f951d3c724e6309164e7f4a6b96b6fdb11 (diff) |
Run monthly statistics instead of one global onefeature/monthly-stats
-rwxr-xr-x | mkstats.sh | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -3,26 +3,30 @@ run_stats () { mr_config=$1 + month=$2 topic=${mr_config#mr-} topic=${topic%.config} - output_dir=`pwd`/stats-$topic-`date -u +'%Y-%m-%d'` + echo $month + output_dir=`pwd`/stats-$topic-$month-`date -u +'%Y-%m-%d'` test -d $output_dir || mkdir $output_dir || exit 1 - # update/clone repos - ./mr -c $mr_config update - # warning: though the -M option is yielding more accurate stats, if you # need strictly backwards-comparable results, leave it out! - ./mr -c $mr_config log -p -M --since='Jan 1 19:00:00 2013' | ../gitdm/gitdm -u -X '\.(sdf|po|dic)\$' -b . -x $output_dir/git-hackers-data.csv -o $output_dir/git-hackers-reports.txt -H $output_dir/hackers.csv || exit 1 + ./mr -c $mr_config log -p -M --since=`date -d "$month month" "+%Y-%m-01"` --before=`date -d "$((month+1)) month" "+%Y-%m-01"` | ../gitdm/gitdm -u -X '\.(sdf|po|dic)\$' -b . -x $output_dir/git-hackers-data.csv -o $output_dir/git-hackers-reports.txt -H $output_dir/hackers.csv || exit 1 # fudge unknown affiliations - for item in $output_dir/git-hackers-data.csv $output_dir/hackers.csv; do - sed -i.bak 's/(Unknown)/Assigned/' $item || exit 1 + for mangle_file in $output_dir/git-hackers-data.csv $output_dir/hackers.csv; do + sed -i.bak 's/(Unknown)/Assigned/' $mangle_file || exit 1 done } # run all known stats for item in mr-*.config; do - run_stats $item + # update/clone repos + ./mr -c $item update + + for month in -1 -2 -3 -4 -5 -6; do + run_stats $item $month + done done |