From a7037b84860be041e251248866fa10aac6020498 Mon Sep 17 00:00:00 2001 From: Cloud user Date: Wed, 27 Jan 2016 17:15:11 +0000 Subject: Add light dashboard Change-Id: I61c2e38b91085d9d6c5f8d5f8a52863bec8aacd6 Signed-off-by: Cloud user --- .../tools/dashboard/opnfv_dashboard_tests.css | 53 ++++++++++ .../tools/dashboard/opnfv_dashboard_tests.html | 25 +++++ .../tools/dashboard/opnfv_dashboard_tests.js | 117 +++++++++++++++++++++ .../dashboard/opnfv_dashboard_tests_conf.json | 29 +++++ 4 files changed, 224 insertions(+) create mode 100644 utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.css create mode 100644 utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.html create mode 100644 utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.js create mode 100644 utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests_conf.json (limited to 'utils') diff --git a/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.css b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.css new file mode 100644 index 000000000..fc7f248b9 --- /dev/null +++ b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.css @@ -0,0 +1,53 @@ +/* Page CSS*/ +body { + background-color:#000000; + font: 10px "Comic Sans MS" ; + color: orange; +} +#title { + font-size: 30px; +} + +#tests { + font-size: 20px; + color: white; +} + +#test_unit { + position: relative; + left: 200px; +} + +/* Chart CSS */ +.chart { + border: 1px dashed orange; + margin: 5px; + padding: 2px; + width: 600px; + height:300px; + float:left; +} + +/* Dygraph CSS */ +/* This applies to the title, x-axis label and y-axis label */ +#div_g .dygraph-label { + font-family: Arial, Helvetica, sans-serif; +} +/* This rule only applies to the chart title */ +#div_g .dygraph-title { + font-size: 12px; + color : orange; +} + /* This rule only applies to the y-axis label */ +#div_g .dygraph-ylabel { + font-size: 10px; + color : orange; +} + +/* Overrides dygraph-legend */ +.dygraph-legend { + font-size: 10px !important; + width: 400px !important; + text-align: left !important; + left: 200px !important; +} diff --git a/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.html b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.html new file mode 100644 index 000000000..908624afe --- /dev/null +++ b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.html @@ -0,0 +1,25 @@ + + + + + + + OPNFV Functest + + + + + + +
FuncTest
+
+ + + diff --git a/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.js b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.js new file mode 100644 index 000000000..93c75c3cb --- /dev/null +++ b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests.js @@ -0,0 +1,117 @@ +/*############################################################################# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +*/ + +// Function to sort data to be ordered according to the time +function sortFunction(a,b){ + var dateA = new Date(a.date).getTime(); + var dateB = new Date(b.date).getTime(); + return dateA > dateB ? 1 : -1; +}; + +// Function to format date according to JS +function formatDate(inputDate){ + var input=inputDate.slice(0,-7); + input=input.replace(' ','T'); + input+='Z'; + return new Date(Date.parse(input)); +} + +// Draw a single graph for a specific test for a specific installer +function drawGraph(filename,installer,test_unit){ + $.getJSON( filename, function(data) { + var serie=[]; + index_test=0; + // find index mapping to the test_unit + for (var i=0;i'+test_unit+''; + } + text_html+='
'; + } +document.getElementById('tests').innerHTML=text_html; + +// debug +console.log(text_html); + +// generate a div per installer (to host the graph) +for (var i in opnfv_dashboard_installers){ + var div_installer='
' + var $newdiv=$(div_installer); + $("body").append($newdiv); +} diff --git a/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests_conf.json b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests_conf.json new file mode 100644 index 000000000..07c1a5e85 --- /dev/null +++ b/utils/test/result_collection_api/tools/dashboard/opnfv_dashboard_tests_conf.json @@ -0,0 +1,29 @@ +var opnfv_dashboard_installers=['apex','compass','fuel','joid']; +var opnfv_dashboard_projects=[ + { + 'functest':{ + 'tempest':['Tempest duration','Tempest nb tests/nb failures'], + 'vPing':['vPing duration'], + 'vPing_userdata':['vPing_userdata duration'], + 'vIMS':['vIMS nb tests passed/failed/skipped','vIMS orchestrator/VNF/test duration'] + } + } +]; + +var opnfv_dashboard_file_directory='res'; +var opnfv_dashboard_file_prefix='res_'; +var opnfv_dashboard_file_suffix='.json'; + +var opnfv_dashboard_ys=['y','y1','y2','y3']; +var opnfv_dashboard_y_labels=['ylabel','y1label','y2label','y3label']; + +var opnfv_dashboard_graph_color_ok="#00FF00"; +var opnfv_dashboard_graph_color_nok="#FF0000"; +var opnfv_dashboard_graph_color_other="#0000FF"; + +var opnfv_dashboard_graph_legend='always'; // legend print +var opnfv_dashboard_graph_title_height=30; // height for the graph title +var opnfv_dashboard_graph_stroke_width=5; // line stroke when mouse over +var opnfv_dashboard_graph_axis_label_color='orange'; +var opnfv_dashboard_graph_text_align='right'; +var opnfv_dashboard_graph_background_color='transparent'; -- cgit 1.2.3-korg