2
3
#TZ=UTC # trace logs are still BST - blech
4
logs=`find /x/launchpad.net-logs/production \
5
-maxdepth 2 -ctime -14 -name launchpad-trace\* | xargs -x`
14
logs=`find ${log_root} \
15
-maxdepth 2 -type f -mtime -${max_log_age} -name launchpad-trace\* \
13
root=${HOME}/public_html/ppr/lpnet
19
root=${HOME}/public_html/ppr/${category}
19
repname="${from}_${until}.html"
22
mkdir -p ${dir}/categories
23
mkdir -p ${dir}/pageids
26
ppr="./page-performance-report.py -v --from=$from --until=$until"
28
$ppr --no-pageids $logs > ${dir}/categories/${repname}
29
$ppr --no-categories $logs > ${dir}/pageids/${repname}
30
$ppr $logs > ${dir}/all/${repname}
32
ln -sf ${dir}/categories/${repname} ${root}/latest-${type}-categories.html
33
ln -sf ${dir}/pageids/${repname} ${root}/latest-${type}-pageids.html
34
ln -sf ${dir}/all/${repname} ${root}/latest-${type}-all.html
22
dir=${root}/${type}_${from}_${until}
26
echo Generating report from $from until $until into $dir `date`
28
./page-performance-report.py -v --from=$from --until=$until \
29
--directory=${dir} $logs
31
ln -sf ${dir}/categories.html ${root}/latest-${type}-categories.html
32
ln -sf ${dir}/pageids.html ${root}/latest-${type}-pageids.html
33
ln -sf ${dir}/combined.html ${root}/latest-${type}-combined.html
39
category_report $* edge /srv/launchpad.net-logs/edge
40
category_report $* lpnet /srv/launchpad.net-logs/production
41
# Store dates in case this takes a while.
42
# 'now' is actually 2 days ago, because we need to wait until the logs
44
now=`date -d '2 days ago' $fmt`
45
yesterday=`date -d '3 days ago' $fmt`
46
last_week=`date -d '9 days ago' $fmt`
47
last_month=`date -d '32 days ago' $fmt`
49
report daily $yesterday $now
50
report weekly $last_week $now
51
## We don't seem to have a months worth of tracelogs. If we enable this,
52
## change the -ctime in the logs= find command.
53
##report monthly $last_month $now
48
report 3 daily `date -d yesterday $fmt` $now
50
if [ `date +%a` = 'Sat' ]; then
51
report 9 weekly `date -d 'last week' $fmt` $now
54
# We don't seem to have a months worth of tracelogs, but we will
55
# generate what we can.
56
if [ `date +%d` = '01' ]; then
57
report 32 monthly `date -d 'last month' $fmt` $now
60
# One off reports to populate history.
61
## report 40 monthly `date -d '1 june 2010' $fmt` `date -d '1 july 2010' $fmt`
62
## report 23 weekly `date -d '19 june 2010' $fmt` `date -d '26 june 2010' $fmt`
63
## report 16 weekly `date -d '26 june 2010' $fmt` `date -d '3 july 2010' $fmt`