r78975 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78974‎ | r78975 | r78976 >
Date:17:11, 24 December 2010
Author:rfaulk
Status:deferred
Tags:
Comment:
fixing time ranges on banner / LP plots and fixing donation filtering in SQL.
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py (modified) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/sql/report_banner_metrics.sql (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()
@@ -446,7 +446,7 @@
447447
448448 query_name = 'report_bannerLP_metrics' # rename query to work with query store
449449 sql_stmnt = query_obj.format_query(query_name, sql_stmnt, [start_time, end_time, campaign])
450 -
 450+ #print sql_stmnt
451451 key_index = query_obj.get_banner_index(query_name)
452452 time_index = query_obj.get_time_index(query_name)
453453 metric_index = query_obj.get_metric_index(query_name, metric_name)
@@ -552,9 +552,9 @@
553553
554554 # Current date & time
555555 now = datetime.datetime.now()
556 - #UTC = 8
557 - #delta = datetime.timedelta(hours=UTC)
558 - #now = now + delta
 556+ UTC = 8
 557+ delta = datetime.timedelta(hours=UTC)
 558+ now = now + delta
559559
560560 # ESTABLISH THE START TIME TO PULL ANALYTICS
561561 hours_back = 24
@@ -608,7 +608,7 @@
609609 if min_elem < min_time:
610610 min_time = min_elem
611611
612 - ranges = [min_time, -1]
 612+ ranges = [min_time, 0]
613613
614614 self.gen_plot(metrics, times, title, xlabel, ylabel, ranges, subplot_index, fname)
615615
Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_banner_metrics.sql
@@ -63,5 +63,5 @@
6464 on ecomm.banner = lp.utm_source and ecomm.hr = lp.hr
6565
6666 group by 1,2,3,4
67 -having impressions > 100000 and donations > 50
 67+having impressions > 100000 and donations > 20
6868 order by 1 desc;

Status & tagging log