Merge lp:~lifeless/lp-dev-utils/ppr into lp:lp-dev-utils

Proposed by Robert Collins
Status: Merged
Merged at revision: 127
Proposed branch: lp:~lifeless/lp-dev-utils/ppr
Merge into: lp:lp-dev-utils
Diff against target: 43 lines (+12/-7)
1 file modified
page-performance-report-daily.sh (+12/-7)
To merge this branch: bzr merge lp:~lifeless/lp-dev-utils/ppr
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+123714@code.launchpad.net

Description of the change

Various improvements to running the PPR daily script, which is intended to be cronnable. Eliminates local diff for ISD's deployment.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

And its all trivial, so self-reviewing.

review: Approve
lp:~lifeless/lp-dev-utils/ppr updated
127. By Robert Collins

Improve the PPR daily shell wrapper to need no edits for deployments.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'page-performance-report-daily.sh'
2--- page-performance-report-daily.sh 2012-08-09 04:53:16 +0000
3+++ page-performance-report-daily.sh 2012-09-11 10:38:22 +0000
4@@ -1,10 +1,15 @@
5-#!/bin/sh
6+#!/bin/bash
7
8 #TZ=UTC # trace logs are still BST - blech
9
10-CATEGORY=lpnet
11-LOGS_ROOTS="/srv/launchpad.net-logs/production /srv/launchpad.net-logs/edge"
12-OUTPUT_ROOT=${HOME}/public_html/ppr/lpnet
13+# Set CONFIG_FILE, LOGS_ROOTS, LOG_PATTERN, OUTPUT_ROOT in the environment
14+# before running this script, to customise its behaviour.
15+
16+CONFIG_FILE=${CONFIG_FILE:-'page-performance-report.ini'}
17+PPR_SWITCHES=${PPR_SWITCHES:-''}
18+LOGS_ROOTS=${LOGS_ROOTS:-"/srv/launchpad.net-logs/production /srv/launchpad.net-logs/edge"}
19+LOG_PATTERN=${LOG_PATTERN:-'launchpad-trace\*'}
20+OUTPUT_ROOT=${OUTPUT_ROOT:-${HOME}/public_html/ppr/lpnet}
21 DAY_FMT="+%Y-%m-%d"
22
23 find_logs() {
24@@ -19,7 +24,7 @@
25
26 find ${LOGS_ROOTS} \
27 -maxdepth 2 -type f -newermt "$from - 1 day" $end_mtime_switch \
28- -name launchpad-trace\* \
29+ -name ${LOG_PATTERN} \
30 | sort | xargs -x
31 }
32
33@@ -67,8 +72,8 @@
34
35 echo Generating report from $from until $until into $dir `date`
36
37- ./page-performance-report.py -v --top-urls=200 --directory=${dir} \
38- $options $files
39+ ./bin/py page-performance-report.py --top-urls=200 --directory=${dir} \
40+ $options ${PPR_SWITCHES} $files
41
42 # Only do the linking if requested.
43 if [ "$link" = "link" ]; then

Subscribers

People subscribed via source and target branches