Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/fundraiser_reporting.py |
— | — | @@ -272,9 +272,9 @@ |
273 | 273 | #now = now + delta |
274 | 274 | |
275 | 275 | |
276 | | - # ESTABLISH THE START TIME TO PULL ANALYTICS |
| 276 | + """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """ |
277 | 277 | hours_back = 24 |
278 | | - times = self.gen_date_strings_hr(now, hours_back) |
| 278 | + times = self.gen_date_strings(now, hours_back,1,1) |
279 | 279 | |
280 | 280 | start_time = times[0] |
281 | 281 | end_time = times[1] |
— | — | @@ -322,9 +322,9 @@ |
323 | 323 | #now = now + delta |
324 | 324 | |
325 | 325 | |
326 | | - # ESTABLISH THE START TIME TO PULL ANALYTICS |
327 | | - days_back = 7 |
328 | | - times = self.gen_date_strings_day(now, days_back) |
| 326 | + """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=0 """ |
| 327 | + hours_back = 7 * 24 # 7 days back |
| 328 | + times = self.gen_date_strings(now, hours_back,1,0) |
329 | 329 | |
330 | 330 | start_time = times[0] |
331 | 331 | end_time = times[1] |
— | — | @@ -539,9 +539,9 @@ |
540 | 540 | #delta = datetime.timedelta(hours=UTC) |
541 | 541 | #now = now + delta |
542 | 542 | |
543 | | - # ESTABLISH THE START TIME TO PULL ANALYTICS |
| 543 | + """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """ |
544 | 544 | hours_back = 24 |
545 | | - times = self.gen_date_strings_hr(now, hours_back) |
| 545 | + times = self.gen_date_strings(now, hours_back,1,1) |
546 | 546 | |
547 | 547 | start_time = times[0] |
548 | 548 | end_time = times[1] |
— | — | @@ -628,10 +628,10 @@ |
629 | 629 | query_name = 'report_latest_campaign' |
630 | 630 | self.init_db() |
631 | 631 | |
632 | | - # Look at campaigns over the past 24 hours |
| 632 | + """ Look at campaigns over the past 24 hours - TS format=1, TS resolution=1 """ |
633 | 633 | now = datetime.datetime.now() |
634 | 634 | hours_back = 72 |
635 | | - times = self.gen_date_strings_hr(now, hours_back) |
| 635 | + times = self.gen_date_strings(now, hours_back,1,1) |
636 | 636 | |
637 | 637 | query_obj = qs.QueryStore() |
638 | 638 | sql_stmnt = mh.read_sql('./sql/report_latest_campaign.sql') |
— | — | @@ -779,9 +779,9 @@ |
780 | 780 | #delta = datetime.timedelta(hours=UTC) |
781 | 781 | #now = now + delta |
782 | 782 | |
783 | | - # ESTABLISH THE START TIME TO PULL ANALYTICS |
| 783 | + """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """ |
784 | 784 | hours_back = 24 |
785 | | - times = self.gen_date_strings_hr(now, hours_back) |
| 785 | + times = self.gen_date_strings_hr(now, hours_back,1,1) |
786 | 786 | |
787 | 787 | start_time = times[0] |
788 | 788 | end_time = times[1] |
Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/TimestampProcessor.py |
— | — | @@ -34,6 +34,18 @@ |
35 | 35 | databases. This includes mapping among timestamp formats and converting those formats to indexed |
36 | 36 | lists and dictionaries. |
37 | 37 | |
| 38 | + Examples of format definitions: |
| 39 | + |
| 40 | + format 1 - 20080101000606 |
| 41 | + format 2 - 2008-01-01 00:06:06 |
| 42 | + |
| 43 | + Examples of resolution definitions: |
| 44 | + |
| 45 | + resolution 0 - xxxx-xx-xx 00:00:00 |
| 46 | + resolution 1 - xxxx-xx-xx xx:00:00 |
| 47 | + resolution 2 - xxxx-xx-xx xx:xx:00 |
| 48 | + resolution 3 - xxxx-xx-xx xx:xx:xx |
| 49 | + |
38 | 50 | METHODS: |
39 | 51 | |
40 | 52 | normalize_timestamps - Takes a list of timestamps as input and converts it to a set of days, hours, or minutes counting back from 0 |