Commit 7013a13a authored by Olav Kvittem's avatar Olav Kvittem

Kjorte for mange tester, la til akkumulert kurve over klokketid

parent b23f11bb
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
<a class="navbar-brand" href="http://www.uninett.no/"><img src="/uninett-theme/images/UNINETT_logo.svg" alt="Uninett logo" type="image/svg+xml"></a> <a class="navbar-brand" href="http://www.uninett.no/"><img src="/mp-web/uninett-theme/images/UNINETT_logo.svg" alt="Uninett logo" type="image/svg+xml"></a>
</div> </div>
<div class="navbar-department"> <div class="navbar-department">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="col-lg-12"> <div class="col-lg-12">
<div class="footer-uninett"> <div class="footer-uninett">
<div class="footer-content-uninett"> <div class="footer-content-uninett">
<div class="footer-logo"> <img src="/uninett-theme/images/Uninett_pil_rod.svg" alt="Uninett logo" type="image/svg+xml"></div> <div class="footer-logo"> <img src="/mp-web/uninett-theme/images/Uninett_pil_rod.svg" alt="Uninett logo" type="image/svg+xml"></div>
<div class="footer-uninett-department">UNINETT AS &copy; 2013-2014, <div class="footer-uninett-department">UNINETT AS &copy; 2013-2014,
<a href="mailto:nav-support@uninett.no">nav-support@uninett.no</a></div> <a href="mailto:nav-support@uninett.no">nav-support@uninett.no</a></div>
</div> </div>
...@@ -50,5 +50,5 @@ ...@@ -50,5 +50,5 @@
<!-- Bootstrap core JavaScript --> <!-- Bootstrap core JavaScript -->
<!-- Placed at the end of the document so the pages load faster --> <!-- Placed at the end of the document so the pages load faster -->
<script src="/uninett-bootstrap-theme/js/bootstrap.min.js"></script> <script src="/mp-web/uninett-bootstrap-theme/js/bootstrap.min.js"></script>
<script src="/uninett-bootstrap-theme/js/holder.js"></script> <script src="/mp-web/uninett-bootstrap-theme/js/holder.js"></script>
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" content=""> <meta name="author" content="">
<link rel="shortcut icon" href="base/uninett-theme/ico/favicon.ico"> <link rel="shortcut icon" href="/mp-web/uninett-theme/ico/favicon.ico">
<!-- Bootstrap core CSS --> <!-- Bootstrap core CSS -->
<link href="base/uninett-theme/css/bootstrap.min.css" rel="stylesheet"> <link href="/mp-web/uninett-theme/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template --> <!-- Custom styles for this template -->
<link href="base/uninett-theme/css/uninett.css" rel="stylesheet"> <link href="/mp-web/uninett-theme/css/uninett.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]--> <![endif]-->
<script type="text/javascript" src="base/js/jquery-ui-1.10.3/jquery-1.9.1.js"> <script type="text/javascript" src="/mp-web/js/jquery-ui-1.10.3/jquery-1.9.1.js">
<!-- <script type="text/javascript" src="base/js/jquery-ui-1.11.0-beta.2.custom/jquery.js"></script> --> <!-- <script type="text/javascript" src="/mp-web/js/jquery-ui-1.11.0-beta.2.custom/jquery.js"></script> -->
...@@ -240,8 +240,9 @@ function make_select( elm, url){ ...@@ -240,8 +240,9 @@ function make_select( elm, url){
html+='<table><tr><td>'; html+='<table><tr><td>';
html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> '; html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> ';
html+='<select id=direction style=width=6em><option value="to">to</option><option value="from">from</option></select>'; html+='<select id=direction style=width=6em><option value="to">to</option><option value="from">from</option></select>';
html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av mleplenavn"></input>'; html+='<td><input id=tr_host value="" placeholder="my host" title="Automatic completion(try \'mp\')"></input>';
html+='<span id=select-house></span>'; html+='<select id=tr_host_menu title="Choose host">host menu</select>';
// html+='<span id=select-house></span>';
var html2=' <td> &nbsp;'; var html2=' <td> &nbsp;';
html2+=' for <input id=tr_times value=5 style="width:2em;text-align:right"> seconds</input>'; html2+=' for <input id=tr_times value=5 style="width:2em;text-align:right"> seconds</input>';
// html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>'; // html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
...@@ -250,6 +251,7 @@ function make_select( elm, url){ ...@@ -250,6 +251,7 @@ function make_select( elm, url){
html2+='on port <input id=tr_port value="5001" title="Default port for iperf3 is 5201" style=width:3em></input>'; html2+='on port <input id=tr_port value="5001" title="Default port for iperf3 is 5201" style=width:3em></input>';
html2+='</table>'; html2+='</table>';
html2+='</form>'; html2+='</form>';
// html+='<button id="toggle">Show menu</button>';
$(elm).html(html+html2); // make sure something is shown $(elm).html(html+html2); // make sure something is shown
...@@ -279,6 +281,15 @@ function make_select( elm, url){ ...@@ -279,6 +281,15 @@ function make_select( elm, url){
// $("#select-house").html(html); // $("#select-house").html(html);
$( "#tr_host" ).autocomplete({ source: items }); $( "#tr_host" ).autocomplete({ source: items });
// $("#tr_opt").select2(); // $("#tr_opt").select2();
populateSelect( $("#tr_host_menu").get(0), items);
$('#tr_host_menu').on('change', function(){
$('#tr_host').val(this.value);
});
// $( "#tr_host" ).combobox();
// $( "#tr_host" ).toggle();
// $( "#toggle" ).click(function() {
// $( "#tr_host" ).toggle();
// });
}); });
request.fail( function( jqXHR, status, error){ request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error); console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
...@@ -391,3 +402,130 @@ function ResultsUpload(dlspeed, ulspeed, rtt){ ...@@ -391,3 +402,130 @@ function ResultsUpload(dlspeed, ulspeed, rtt){
} }
}) })
} }
// populates select list from array of items given as objects: { name: 'text', value: 'value' }
function populateSelect(el, items) {
el.options.length = 0;
if (items.length > 0)
el.options[0] = new Option('or select', '');
$.each(items, function () {
el.options[el.options.length] = new Option(this, this);
});
}
//--------------------------------------------------------------------------------
// jquery combobox from select
(function( $ ) {
$.widget( "custom.combobox", {
_create: function() {
this.wrapper = $( "<span>" )
.addClass( "custom-combobox" )
.insertAfter( this.element );
this.element.hide();
this._createAutocomplete();
this._createShowAllButton();
},
_createAutocomplete: function() {
var selected = this.element.children( ":selected" ),
value = selected.val() ? selected.text() : "";
this.input = $( "<input>" )
.appendTo( this.wrapper )
.val( value )
.attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
.autocomplete({
delay: 0,
minLength: 0,
source: $.proxy( this, "_source" )
})
.tooltip({
tooltipClass: "ui-state-highlight"
});
this._on( this.input, {
autocompleteselect: function( event, ui ) {
ui.item.option.selected = true;
this._trigger( "select", event, {
item: ui.item.option
});
},
autocompletechange: "_removeIfInvalid"
});
},
_createShowAllButton: function() {
var input = this.input,
wasOpen = false;
$( "<a>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.tooltip()
.appendTo( this.wrapper )
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "custom-combobox-toggle ui-corner-right" )
.mousedown(function() {
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
})
.click(function() {
input.focus();
// Close if already visible
if ( wasOpen ) {
return;
}
// Pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
});
},
_source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( this.element.children( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text,
value: text,
option: this
};
}) );
},
_removeIfInvalid: function( event, ui ) {
// Selected an item, nothing to do
if ( ui.item ) {
return;
}
// Search for a match (case-insensitive)
var value = this.input.val(),
valueLowerCase = value.toLowerCase(),
valid = false;
this.element.children( "option" ).each(function() {
if ( $( this ).text().toLowerCase() === valueLowerCase ) {
this.selected = valid = true;
return false;
}
});
// Found a match, nothing to do
if ( valid ) {
return;
}
// Remove invalid value
this.input
.val( "" )
.attr( "title", value + " didn't match any item" )
.tooltip( "open" );
this.element.val( "" );
this._delay(function() {
this.input.tooltip( "close" ).attr( "title", "" );
}, 2500 );
this.input.autocomplete( "instance" ).term = "";
},
_destroy: function() {
this.wrapper.remove();
this.element.show();
}
});
})( jQuery );
...@@ -12,6 +12,7 @@ function debug_log ( msg){ ...@@ -12,6 +12,7 @@ function debug_log ( msg){
} }
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
function make_table(mtr_rows){ function make_table(mtr_rows){
...@@ -125,6 +126,7 @@ function make_select( elm, url){ ...@@ -125,6 +126,7 @@ function make_select( elm, url){
html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_interval\').val() )">'; html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_interval\').val() )">';
html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> to '; html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> to ';
html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av målepålenavn"></input>'; html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av målepålenavn"></input>';
html+='<button id="toggle">Show menu</button>';
html+=' for <input id=tr_times value=3 style="width:3em;text-align:right"> seconds</input>'; html+=' for <input id=tr_times value=3 style="width:3em;text-align:right"> seconds</input>';
// html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>'; // html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
html+=', report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.'; html+=', report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.';
...@@ -152,7 +154,11 @@ html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), ...@@ -152,7 +154,11 @@ html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(),
}); });
// html+='</select>'; // html+='</select>';
// $(elm).html(html+'</select></form>'); // $(elm).html(html+'</select></form>');
$( "#tr_host" ).autocomplete({ source: items }); // $( "#tr_host" ).autocomplete({ source: items });
$( "#tr_host" ).combobox({ source: items });
$( "#toggle" ).click(function() {
$( "#combobox" ).toggle();
});
}); });
request.fail( function( jqXHR, status, error){ request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error); console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
...@@ -252,3 +258,116 @@ $(document).ready( function(){ ...@@ -252,3 +258,116 @@ $(document).ready( function(){
}); });
(function( $ ) {
$.widget( "custom.combobox", {
_create: function() {
this.wrapper = $( "<span>" )
.addClass( "custom-combobox" )
.insertAfter( this.element );
this.element.hide();
this._createAutocomplete();
this._createShowAllButton();
},
_createAutocomplete: function() {
var selected = this.element.children( ":selected" ),
value = selected.val() ? selected.text() : "";
this.input = $( "<input>" )
.appendTo( this.wrapper )
.val( value )
.attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
.autocomplete({
delay: 0,
minLength: 0,
source: $.proxy( this, "_source" )
})
.tooltip({
tooltipClass: "ui-state-highlight"
});
this._on( this.input, {
autocompleteselect: function( event, ui ) {
ui.item.option.selected = true;
this._trigger( "select", event, {
item: ui.item.option
});
},
autocompletechange: "_removeIfInvalid"
});
},
_createShowAllButton: function() {
var input = this.input,
wasOpen = false;
$( "<a>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.tooltip()
.appendTo( this.wrapper )
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "custom-combobox-toggle ui-corner-right" )
.mousedown(function() {
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
})
.click(function() {
input.focus();
// Close if already visible
if ( wasOpen ) {
return;
}
// Pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
});
},
_source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( this.element.children( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text,
value: text,
option: this
};
}) );
},
_removeIfInvalid: function( event, ui ) {
// Selected an item, nothing to do
if ( ui.item ) {
return;
}
// Search for a match (case-insensitive)
var value = this.input.val(),
valueLowerCase = value.toLowerCase(),
valid = false;
this.element.children( "option" ).each(function() {
if ( $( this ).text().toLowerCase() === valueLowerCase ) {
this.selected = valid = true;
return false;
}
});
// Found a match, nothing to do
if ( valid ) {
return;
}
// Remove invalid value
this.input
.val( "" )
.attr( "title", value + " didn't match any item" )
.tooltip( "open" );
this.element.val( "" );
this._delay(function() {
this.input.tooltip( "close" ).attr( "title", "" );
}, 2500 );
this.input.autocomplete( "instance" ).term = "";
},
_destroy: function() {
this.wrapper.remove();
this.element.show();
}
});
})( jQuery );
\ No newline at end of file
...@@ -16,11 +16,11 @@ Se mer om <a class="btn btn-default" href="http://www.uninett.no/malepale">mål ...@@ -16,11 +16,11 @@ Se mer om <a class="btn btn-default" href="http://www.uninett.no/malepale">mål
<div class="col-lg-12 gutter uninett-padded uninett-color-lightBlue"> <div class="col-lg-12 gutter uninett-padded uninett-color-lightBlue">
<h3>Tjenester mot denne målepålen</h3> <h3>Tjenester mot denne målepålen</h3>
<p><a class="btn btn-primary btn-lg" href="base/rute/">Rute</a> viser ruten trafikken tar fra målepålen mot deg. <p><a class="btn btn-primary btn-lg" href="/mp-web/rute/">Rute</a> viser ruten trafikken tar fra målepålen mot deg.
<p><a class="btn btn-primary btn-lg" href="base/yt/">Yt</a> måler hvor fort du kan overføre data mellom deg og målepålen. Enkel og brukervennlig. <p><a class="btn btn-primary btn-lg" href="/mp-web/yt/">Yt</a> måler hvor fort du kan overføre data mellom deg og målepålen. Enkel og brukervennlig.
<p><a class="btn btn-primary btn-lg" href="base/iperf/">Iperf</a> måler ytelsen fra målepålen mot en annen målepåle eller maskin med Iperf. </p> <p><a class="btn btn-primary btn-lg" href="/mp-web/iperf/">Iperf</a> måler ytelsen fra målepålen mot en annen målepåle eller maskin med Iperf. </p>
<!-- ok discontinued due to bad TCP <!-- ok discontinued due to bad TCP
<p><a href="base/ndt/">NDT</a> (Network Diagnostic Tool) måler ytelsen fra din klient mot målepålen - Er mer teknisk. </p> <p><a href="/mp-web/ndt/">NDT</a> (Network Diagnostic Tool) måler ytelsen fra din klient mot målepålen - Er mer teknisk. </p>
--> -->
<!-- <!--
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<script type="text/javascript" src="/js/jquery-ui-1.10.3/jquery-1.9.1.js"></script> <script type="text/javascript" src="/js/jquery-ui-1.10.3/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.10.3/ui/jquery-ui.js"></script> <script type="text/javascript" src="/js/jquery-ui-1.10.3/ui/jquery-ui.js"></script>
<style type="text/css" title="currentStyle"> <style type="text/css" title="currentStyle">
@import "/js/jquery-ui-1.10.3/themes/base/jquery-ui.css"; @import "/js/jquery-ui-1.10.3/themes//mp-web/jquery-ui.css";
</style> </style>
</head> </head>
......
<!DOCTYPE html> <html lang="no"> <!DOCTYPE html> <html lang="no">
<head> <head>
<?php include 'base/head-bs.html'?> <?php include 'head-bs.html'?>
<style type="text/css" title="currentStyle"> <style type="text/css" title="currentStyle">
@import "base/js/jquery-ui-1.10.3/themes/base/jquery-ui.css"; @import "/mp-web/js/jquery-ui-1.10.3/themes/base/jquery-ui.css";
</style> </style>
<script type="text/javascript" src="base/js/jquery-ui-1.10.3/ui/jquery-ui.js"></script> <script type="text/javascript" src="/mp-web/js/jquery-ui-1.10.3/ui/jquery-ui.js"></script>
<link href="base/js/select2/select2.css" rel="stylesheet"/> <link href="/mp-web/js/select2/select2.css" rel="stylesheet"/>
<script type="text/javascript" src="base/js/select2/select2.js"></script> <script type="text/javascript" src="/mp-web/js/select2/select2.js"></script>
<script type="text/javascript" src="base/js/mp-select.js"></script> <script type="text/javascript" src="/mp-web/js/mp-select.js"></script>
</head> </head>
<body> <body>
<?php include 'body-bs.html'?> <?php include 'body-bs.html'?>
<script> <script>
$("#title-bs").html('<a href="https://www.uninett.no/malepale-detaljer">Mleple</a>'); // title $("#title-bs").html('<a href="https://www.uninett.no/malepale-detaljer">Mleple</a>'); // title
$('#top-menu-bs').load("base/top-menu-bs.html"); $('#top-menu-bs').load("/mp-web/top-menu-bs.html");
$('#body-bs').load("mp-web-bs.html"); // main body content $('#body-bs').load("mp-web-bs.html"); // main body content
</script> </script>
......
<ul id="top-menu-ul" class='nav navbar-nav'> <ul id="top-menu-ul" class='nav navbar-nav'>
<li> <a href="base/">Oversikt</a></li> <li> <a href="/mp-web/">Oversikt</a></li>
<li><a href="base/yt/">Yt</a></li> <li><a href="/mp-web/yt/">Yt</a></li>
<li><a href="base/rute/">Rute</a></li> <li><a href="/mp-web/rute/">Rute</a></li>
<li><a href="base/iperf/">Iperf</a> <li><a href="/mp-web/iperf/">Iperf</a>
<!-- ndt discontinued due kernel tcp problems <!-- ndt discontinued due kernel tcp problems
<li><a href="/ndt/">NDT</a></li> <li><a href="/ndt/">NDT</a></li>
--> -->
<li><a href="http://mping.uninett.no/">MPing</a></li> <li><a href="http://mping.uninett.no/">MPing</a></li>
<li><a href="http://testnett.uninett.no/matrix/">Multicast beacon</a></li> <li><a href="http://testnett.uninett.no/matrix/">Multicast beacon</a></li>
<!-- <!--
<li><a href="base/matrix/>Multicast beacon</a>"</li> <li><a href="/mp-web/matrix/>Multicast beacon</a>"</li>
<li><a href="base/appmon">AppMon</a></li> <li><a href="/mp-web/appmon">AppMon</a></li>
<li><a href=http://uninett.no><img src="/images/UNINETT_logo_t.png" alt="uninettlogo" /></a> <li><a href=http://uninett.no><img src="/images/UNINETT_logo_t.png" alt="uninettlogo" /></a>
--> -->
</ul> </ul>
...@@ -89,6 +89,7 @@ at about <td><form name="speedtest" id="speedform"> ...@@ -89,6 +89,7 @@ at about <td><form name="speedtest" id="speedform">
<span id=response></span> <span id=response></span>
<div id=trend style=width:100%></div>
<div id=graf style=width:100%></div> <div id=graf style=width:100%></div>
<!-- <!--
......
...@@ -27,7 +27,7 @@ var upload; // object for starting upload ...@@ -27,7 +27,7 @@ var upload; // object for starting upload
//var ulspeedsum=0, uldiffsum=0, ulbytesum=0, ulno=0; //var ulspeedsum=0, uldiffsum=0, ulbytesum=0, ulno=0;
//var dlspeedsum=0, dldiffsum=0, dlbytesum=0, dlno=0 ; //var dlspeedsum=0, dldiffsum=0, dlbytesum=0, dlno=0 ;
var dlavg=0, ulavg=0; var dlsum=0, ulsum=0;
var dlseriesavg; var ulseriesavg; // data series for curves var dlseriesavg; var ulseriesavg; // data series for curves
var dldiffs=[], uldiffs=[]; var dldiffs=[], uldiffs=[];
var dlspeeds=[], ulspeeds=[]; var dlspeeds=[], ulspeeds=[];
...@@ -48,7 +48,9 @@ var downcolor='#00612b'; ...@@ -48,7 +48,9 @@ var downcolor='#00612b';
var colors={'up': upcolor, 'down': downcolor}; var colors={'up': upcolor, 'down': downcolor};
//var series=[{ 'name':'Download', data:[], type: 'scatter' , color: downcolor }, //var series=[{ 'name':'Download', data:[], type: 'scatter' , color: downcolor },
// { 'name':'Upload', data:[], type: 'scatter' , color: upcolor }]; // { 'name':'Upload', data:[], type: 'scatter' , color: upcolor }];
var chart; var chart;
var trend_chart, trend_series=[], trend_data=[];
var trend_name={"up":"Upload trend", "down": "Download trend"}
$(document).ready(function() { $(document).ready(function() {
...@@ -71,7 +73,7 @@ function test_performance(dir){ ...@@ -71,7 +73,7 @@ function test_performance(dir){
TestRoundTrip(); TestRoundTrip();
if (! chart){ // creat new chart if (! chart){ // creat new chart
chart=tegn_graf('graf', 'Bandwidth graph', 'With '+ document.location.hostname, [], '', 0 ); chart=tegn_graf('graf', 'Bandwidth detail', 'With '+ document.location.hostname, [], '', 0 , 'linear');
} }
...@@ -177,11 +179,12 @@ function get_progress(e, probj) { // to be called onprogress in ajax ...@@ -177,11 +179,12 @@ function get_progress(e, probj) { // to be called onprogress in ajax
temp_span[probj.dir] = new stats(); temp_span[probj.dir] = new stats();
var str=probj.dir; var str=probj.dir;
str=str.substring(0, 1).toUpperCase() + str.substring(1, str.length); // capitalize str=str.substring(0, 1).toUpperCase() + str.substring(1, str.length); // capitalize
temp_series[probj.dir] = chart.addSeries( { 'name': str + 'load ' + '..' , data:[], type: 'scatter' , color: colors[probj.dir] }); temp_series[probj.dir] = chart.addSeries( { 'name': str + 'load ' + '..' , data:[], type: 'scatter' , color: colors[probj.dir] });
} }
temp_speed[probj.dir].add(mbps); temp_speed[probj.dir].add(mbps);
temp_span[probj.dir].add(span); temp_span[probj.dir].add(span);
if ( temp_speed[probj.dir].n % noparallels[probj.runno] == 0 ){ if ( temp_speed[probj.dir].n % noparallels[probj.runno] == 0 ){
// temp_series[probj.dir].addPoint([probj.begin+temp_span[probj.dir].average(),
temp_series[probj.dir].addPoint([temp_span[probj.dir].average()/1000, temp_series[probj.dir].addPoint([temp_span[probj.dir].average()/1000,
temp_speed[probj.dir].sum]); temp_speed[probj.dir].sum]);
temp_speed[probj.dir] = new stats(); temp_speed[probj.dir] = new stats();
...@@ -409,6 +412,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) { ...@@ -409,6 +412,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
timeout: test_period, timeout: test_period,
error: function(xhr, textStatus, errorThrown){ error: function(xhr, textStatus, errorThrown){
if ( textStatus === 'timeout'){ if ( textStatus === 'timeout'){
probj.done=true;
upload_complete( probj.loaded, probj ); upload_complete( probj.loaded, probj );
console.log( 'timeout bytes ' + probj.loaded ); console.log( 'timeout bytes ' + probj.loaded );
} else {