r79163 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79162‎ | r79163 | r79164 >
Date:05:34, 29 December 2010
Author:rfaulk
Status:deferred
Tags:
Comment:
Touch up work on custom latest plot reporting.
Modified paths:
  • /trunk/fundraiser-statistics/bash/plot_build_latest.sh (modified) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py (modified) (history)
  • /trunk/fundraiser-statistics/reporting/custom_campaign_plot.php (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py
@@ -48,8 +48,8 @@
4949 def init_db(self):
5050 """ Establish connection """
5151 #db = MySQLdb.connect(host='db10.pmtpa.wmnet', user='rfaulk', db='faulkner')
52 - self.db = MySQLdb.connect(host='127.0.0.1', user='rfaulk', db='faulkner', port=3307)
53 - #self.db = MySQLdb.connect(host='storage3.pmtpa.wmnet', user='rfaulk', db='faulkner')
 52+ #self.db = MySQLdb.connect(host='127.0.0.1', user='rfaulk', db='faulkner', port=3307)
 53+ self.db = MySQLdb.connect(host='storage3.pmtpa.wmnet', user='rfaulk', db='faulkner')
5454
5555 """ Create cursor """
5656 self.cur = self.db.cursor()
@@ -435,8 +435,8 @@
436436 def __init__(self, *args):
437437
438438 if len(args) == 2:
439 - self.campaign = campaign
440 - self.start_time = start_time
 439+ self.campaign = args[0]
 440+ self.start_time = args[1]
441441 else:
442442 self.campaign = None
443443 self.start_time = None
@@ -563,9 +563,9 @@
564564
565565 # Current date & time
566566 now = datetime.datetime.now()
567 - UTC = 8
568 - delta = datetime.timedelta(hours=UTC)
569 - now = now + delta
 567+ #UTC = 8
 568+ #delta = datetime.timedelta(hours=UTC)
 569+ #now = now + delta
570570
571571 # ESTABLISH THE START TIME TO PULL ANALYTICS
572572 hours_back = 24
Index: trunk/fundraiser-statistics/reporting/custom_campaign_plot.php
@@ -34,17 +34,16 @@
3535 $cmpgn=$_POST["utm_campaign"];
3636
3737 // generate plots
38 -$home_path = './plot_build_latest.sh';
39 -$cmd_arr = array();
4038 $args = ' ' . $cmpgn . ' ' . $start;
41 -$cmd = 'sh plot_build_latest.sh' . $args;
 39+// $cmd = 'echo "baggin5" | sudo -S ./plot_build_latest.sh' . $args;
 40+$cmd = './plot_build_latest.sh' . $args;
4241
43 -
4442 chdir('/home/rfaulk/fundraiser-statistics/bash/');
45 -// $output= shell_exec($cmd);
4643
4744 // Execute the shell command
48 -$output = shell_exec($cmd);
 45+//$output1 = shell_exec($cmd . ' 2>&1');
 46+//$output2 = shell_exec('whoami');
 47+$output = shell_exec('echo ' . $cmd. $args . ' >async_plotter.sh');
4948
5049 echo '<html>';
5150 echo '<head>';
@@ -52,8 +51,9 @@
5352 echo '</head>';
5453 echo '<body>';
5554
56 -echo $cmd . '<br>';
57 -echo $output . '<br>';
 55+// echo $cmd . '<br>';
 56+// echo $output . '<br>';
 57+// echo $output2 . '<br>';
5858 echo 'Plots are generating, results will be up momentarily.<br>';
5959 echo '<a href="http://fundraising.wikimedia.org/stats/reporting_latest.html">Back to latest Reports</a><br>';
6060
Index: trunk/fundraiser-statistics/bash/plot_build_latest.sh
@@ -10,4 +10,6 @@
1111
1212 cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_LP_metrics_don_per_view_latest.png /srv/org.wikimedia.fundraising/stats/
1313 cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_don_per_imp_latest.png /srv/org.wikimedia.fundraising/stats/
14 -cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_click_rate_latest.png /srv/org.wikimedia.fundraising/stats/
\ No newline at end of file
 14+cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_click_rate_latest.png /srv/org.wikimedia.fundraising/stats/
 15+
 16+echo "" > async_plotter.sh
\ No newline at end of file

Status & tagging log