r88944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88943‎ | r88944 | r88945 >
Date:23:03, 26 May 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
Added methods to SquidLogTableLoader Class:

get_completion_rate_of_latest_log
get_all_rows_unique_start_time

These methods are used for Log Miner Logging (LML) reports
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/classes/DataLoader.py (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/DataLoader.py
@@ -1246,6 +1246,46 @@
12471247 return 0
12481248
12491249
 1250+ def get_all_rows_unique_start_time(self):
 1251+
 1252+ select_stmnt = 'select type, log_copy_time, start_time, end_time, log_completion_pct, total_rows from ' \
 1253+ '(select max(log_copy_time) as max_copy_time from squid_log_record group by start_time) as temp join squid_log_record on max_copy_time = squid_log_record.log_copy_time'
 1254+
 1255+ self.init_db()
 1256+
 1257+ try:
 1258+ self._cur_.execute(select_stmnt)
 1259+ results = self._cur_.fetchall()
 1260+ except:
 1261+ self._db_.rollback()
 1262+ self.close_db()
 1263+ print >> sys.stderr, 'Could not execute: ' + update_stmnt
 1264+ return -1
 1265+ else:
 1266+ self.close_db()
 1267+
 1268+ return results
 1269+
 1270+ def get_completion_rate_of_latest_log(self):
 1271+
 1272+ select_stmnt = 'select type, start_time, log_completion_pct, log_completion_pct from (select max(log_copy_time) as max_copy_time from squid_log_record) as temp join squid_log_record on max_copy_time = squid_log_record.log_copy_time'
 1273+
 1274+ self.init_db()
 1275+
 1276+ try:
 1277+ self._cur_.execute(select_stmnt)
 1278+ results = self._cur_.fetchall()
 1279+ except:
 1280+ self._db_.rollback()
 1281+ self.close_db()
 1282+ print >> sys.stderr, 'Could not execute: ' + update_stmnt
 1283+ return -1
 1284+ else:
 1285+ self.close_db()
 1286+
 1287+ return results
 1288+
 1289+
12501290 """
12511291
12521292 CLASS :: ImpressionTableLoader

Status & tagging log