From f6641c898b4ef5a6bd7f0d504404ac3576f9a397 Mon Sep 17 00:00:00 2001 From: itraviv Date: Sun, 13 Nov 2016 17:38:22 +0200 Subject: added scripts and asciidoc for automated creation of trex analytics report. the creation is done by issuing './b build --performance' command Signed-off-by: itraviv --- doc/ws_main.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'doc/ws_main.py') diff --git a/doc/ws_main.py b/doc/ws_main.py index 237ea743..9d2882c8 100755 --- a/doc/ws_main.py +++ b/doc/ws_main.py @@ -250,6 +250,7 @@ def scansize(self): def options(opt): opt.add_option('--exe', action='store_true', default=False, help='Execute the program after it is compiled') + opt.add_option('--performance', action='store_true', help='Build a performance report based on google analytics') def configure(conf): search_path = '~/.local/bin /usr/local/bin/ /usr/bin' @@ -887,8 +888,12 @@ def build_cp(bld,dir,root,callback): - - +def create_analytic_report(task): + try: + import AnalyticsWebReport as analytics + analytics.main() + except: + raise Exception('Error importing or using AnalyticsWebReport script') @@ -916,6 +921,11 @@ def build(bld): bld(rule=my_copy, target=x) bld.add_group() + if bld.options.performance: + bld(rule=create_analytic_report) + bld(rule=convert_to_html_toc_book, source='trex_analytics.asciidoc waf.css', target='trex_analytics.html',scan=ascii_doc_scan); + return + bld(rule=my_copy, target='my_chart.js') build_cp(bld,'hlt_args.asciidoc','stl/trex_stl_lib', parse_hlt_args) @@ -973,7 +983,7 @@ def build(bld): bld(rule=convert_to_html_toc_book, source='trex_rpc_server_spec.asciidoc waf.css', target='trex_rpc_server_spec.html',scan=ascii_doc_scan); - + bld(rule=convert_to_html_toc_book, source='trex_scapy_rpc_server.asciidoc waf.css', target='trex_scapy_rpc_server.html',scan=ascii_doc_scan); -- cgit 1.2.3-korg