summaryrefslogtreecommitdiffstats
path: root/doc/AnalyticsWebReport.py
diff options
context:
space:
mode:
authoritraviv <itraviv@cisco.com>2016-11-27 18:32:16 +0200
committeritraviv <itraviv@cisco.com>2016-11-27 18:32:26 +0200
commita41bd98b41c661f21d82d54c5b66cd97a290e337 (patch)
treeeb743021c0a562195acffb18e9d7db60526290a5 /doc/AnalyticsWebReport.py
parentecd6e618a0f7975812502a6cab9196676284b264 (diff)
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 <itraviv@cisco.com>
Diffstat (limited to 'doc/AnalyticsWebReport.py')
-rwxr-xr-xdoc/AnalyticsWebReport.py7
1 files changed, 5 insertions, 2 deletions
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.')