Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/DataLoader.py |
— | — | @@ -1246,6 +1246,46 @@ |
1247 | 1247 | return 0 |
1248 | 1248 | |
1249 | 1249 | |
| 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 | + |
1250 | 1290 | """ |
1251 | 1291 | |
1252 | 1292 | CLASS :: ImpressionTableLoader |