summaryrefslogtreecommitdiffstats
path: root/doc/AnalyticsWebReport.py
diff options
context:
space:
mode:
authoritraviv <itraviv@cisco.com>2017-01-12 15:45:35 +0200
committeritraviv <itraviv@cisco.com>2017-01-12 15:45:58 +0200
commit6cdb4a984508a27a94df24ba9dabf050f3c319fd (patch)
treeab989d0d0f72dd29f28e053246d233c8e3be2df9 /doc/AnalyticsWebReport.py
parent32366ab4524073ab59e59fc9895b0b2d5a73b438 (diff)
added option to support input from elk in analyticsWebReport, added TRexDataAnalysisV2 that has OOP design, added details to asciidoc that provide more info on how we calculate MPPS/Core
Signed-off-by: itraviv <itraviv@cisco.com>
Diffstat (limited to 'doc/AnalyticsWebReport.py')
-rwxr-xr-xdoc/AnalyticsWebReport.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/doc/AnalyticsWebReport.py b/doc/AnalyticsWebReport.py
index e3f6504b..04058a02 100755
--- a/doc/AnalyticsWebReport.py
+++ b/doc/AnalyticsWebReport.py
@@ -6,21 +6,24 @@ import time
import datetime
-def main(verbose=False, detailed_test_stats=''):
- if verbose:
- print('Retrieving data from Google Analytics')
- analytics = ac.initialize_analyticsreporting()
- current_date = time.strftime("%Y-%m-%d")
- 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)
+def main(verbose=False, source='ga', detailed_test_stats='yes'):
+ if source == 'ga':
+ if verbose:
+ print('Retrieving data from Google Analytics')
+ analytics = ac.initialize_analyticsreporting()
+ current_date = time.strftime("%Y-%m-%d")
+ 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)
+ all_data_dict, setups = ac.export_to_tuples(response)
+ if source == 'elk':
+ all_data_dict = 0 # INSERT JSON FROM ELK HERE
dest_path = os.path.join(os.getcwd(), 'build', 'images')
if verbose:
print('Saving data to %s' % dest_path)
if detailed_test_stats:
print('generating detailed table for test results')
- tr.create_all_data(ga_all_data_dict, start_date, current_date, save_path=dest_path,
+ tr.create_all_data(all_data_dict, start_date, current_date, save_path=dest_path,
detailed_test_stats=detailed_test_stats)
if verbose:
print('Done without errors.')