summaryrefslogtreecommitdiffstats
path: root/doc/AnalyticsWebReport.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-11-17 16:52:27 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-11-17 16:52:27 +0200
commit1a175f47f0cc3010af47b4b18d5b01724950f0a0 (patch)
tree7a693d145fa43a3fcc98bfaa88c39393cb780e8f /doc/AnalyticsWebReport.py
parent0ec066bae9370df9d45214e41ae61db73783d675 (diff)
docs fixes:
http->https on jquery address fix paths in performance job add separator between creating and using performance data Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'doc/AnalyticsWebReport.py')
-rwxr-xr-xdoc/AnalyticsWebReport.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/doc/AnalyticsWebReport.py b/doc/AnalyticsWebReport.py
index 9bf186bd..182d8367 100755
--- a/doc/AnalyticsWebReport.py
+++ b/doc/AnalyticsWebReport.py
@@ -5,14 +5,20 @@ import TRexDataAnalysis as tr
import time
-def main():
- analytics = ac.initialize_analyticsreporting()
- # print 'retrieving data from Google Analytics'
- current_date = time.strftime("%Y-%m-%d")
- response = ac.get_report(analytics, '2016-11-06', current_date)
- ga_all_data_dict, setups = ac.export_to_tuples(response)
- tr.create_all_data(ga_all_data_dict, setups, '2016-11-06', current_date, save_path=os.getcwd() + '/images/',
- add_stats='yes')
+def main(verbose = False):
+ if verbose:
+ 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)
+ 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,
+ add_stats='yes')
+ if verbose:
+ print('Done without errors.')
if __name__ == "__main__":
- main()
+ main()