From a41bd98b41c661f21d82d54c5b66cd97a290e337 Mon Sep 17 00:00:00 2001 From: itraviv Date: Sun, 27 Nov 2016 18:32:16 +0200 Subject: added howto guide on how to make the tracking environment. changed the analytics web report to fetch last 15 days of regression. added rule to ws_main to build the howto guide Signed-off-by: itraviv --- doc/AnalyticsWebReport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/AnalyticsWebReport.py') diff --git a/doc/AnalyticsWebReport.py b/doc/AnalyticsWebReport.py index 182d8367..bd4a9a2b 100755 --- a/doc/AnalyticsWebReport.py +++ b/doc/AnalyticsWebReport.py @@ -3,6 +3,7 @@ import sys import AnalyticsConnect as ac import TRexDataAnalysis as tr import time +import datetime def main(verbose = False): @@ -10,12 +11,14 @@ def main(verbose = False): print('Retrieving data from Google Analytics') analytics = ac.initialize_analyticsreporting() current_date = time.strftime("%Y-%m-%d") - response = ac.get_report(analytics, '2016-11-06', current_date) + k_days_ago = datetime.datetime.now() - datetime.timedelta(days=15) + start_date = str(k_days_ago.date()) + response = ac.get_report(analytics, start_date, current_date) ga_all_data_dict, setups = ac.export_to_tuples(response) dest_path = os.path.join(os.getcwd(), 'build', 'images') if verbose: print('Saving data to %s' % dest_path) - tr.create_all_data(ga_all_data_dict, setups, '2016-11-06', current_date, save_path = dest_path, + tr.create_all_data(ga_all_data_dict, setups, start_date, current_date, save_path = dest_path, add_stats='yes') if verbose: print('Done without errors.') -- cgit 1.2.3-korg