Commit 777c3c2b authored by Olav Kvittem's avatar Olav Kvittem

Changed to js-only version with bootstrap templates

parent 6f69f4d8
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
......
mp-web-bs.php
\ No newline at end of file
mp-web-main-js.php
\ No newline at end of file
<div class="gutter uninett-padded uninett-color-lightGreen">
<div class="gutter uninett-padded uninett-color-lightBlue">
<h3>Throughput analysis by <span id=hostname></span>
<h3>Iperf throughput analysis by <span id=hostname></span>
<script>$("#hostname").html(location.hostname)</script> </h3>
<p> <span id=tr_button></span>
<script>make_select( '#tr_button', mp_url );</script>
......@@ -28,9 +28,10 @@
<li>Graphs have mouseover info, and click legend to remove curve
</ul>
<p>The service uses the <a href="http://en.wikipedia.org/wiki/Iperf">iperf program</a> for the probing, please refer to that for technical details.
<p>You need to have an iperf3 server running on the target machine.
<p>The service uses the <a href="http://en.wikipedia.org/wiki/Iperf">iperf3 program</a> for the probing, please refer to that for technical details.
<p>It works by starting iperf session from the host you are accessing towards the selected target host and waits for the results. This takes som time to do because of inherent mode of operation.
<li>You may run the iperf program manually on your own host as client og server.
<li>You may run the iperf program manually on your own host as client or server.
<li>Iperf is available as a comman line
version and also with a more visual Java based interface.
<li> Download from http://iperf.sourceforge.net/ .
......
......@@ -7,7 +7,7 @@
<script type="text/javascript" src="/js/Highcharts/js/highcharts.js"></script>
<!-- <script type="text/javascript" src=Highcharts/js/modules/exporting.js></script> -->
<!-- <script type="text/javascript" data-main="main" src="/js/require.js"></script> -->
<link rel="stylesheet" type="text/css" media="all" href="/style/mp-style.css" />
<!-- <link rel="stylesheet" type="text/css" media="all" href="/style/mp-style.css" /> -->
<style type="text/css" title="currentStyle">
@import "/js/jquery-ui-1.10.3/themes/base/jquery-ui.css";
......@@ -22,7 +22,7 @@
<body>
<?php include '../body-bs.html'?>
<script>
$("#title-bs").html('Iperf througput'); // title
$("#title-bs").html('Mleple'); // title
$('#top-menu-bs').load("/top-menu-bs.html");
$('#body-bs').load("iperf-body.html", // main body content
function(responseText, textStatus, XMLHttpRequest){
......
......@@ -64,7 +64,7 @@ function iperf(host, nobs, interval){
html += '<thead><th>[ID]<th>Interval<th>Transfer<th>Bandwidth</thead><tbody>';
var xtime=0.0;
$.each(mtr_rows, function(tr) {
if ( mtr_rows[tr].length === 7 && ! isNaN(mtr_rows[tr][5]) ){ // is a data row
if ( mtr_rows[tr].length === 8 && $.isNumeric(mtr_rows[tr][5]) ){ // is a data row
html += '<tr><td>' + mtr_rows[tr][0]
+ '<td>' + mtr_rows[tr][1]+ ' ' + mtr_rows[tr][2]
+ '<td>' + mtr_rows[tr][3]+ ' ' + mtr_rows[tr][4]
......@@ -72,8 +72,17 @@ function iperf(host, nobs, interval){
+ "\n";
var inter = mtr_rows[tr][1]; // like 0.5-1.0 sec
xtime= parseFloat(inter.match(/[\d\.]+/g )[1] );
bytes.push( [ xtime, parseInt( mtr_rows[tr][3]) ] );
thru.push( [ xtime, parseInt( mtr_rows[tr][5]) ] );
var units=["K", "M", "G", "T"];
var factors=[1, 0.001, 1, 1000, 1000000];
var Bunit=mtr_rows[tr][4].substr(0,1);
var bunit=mtr_rows[tr][6].substr(0,1);
var Bfactor=factors[ units.indexOf(Bunit) + 1 ];
var bfactor=factors[ units.indexOf(bunit) + 1 ];
bytes.push( [ xtime, parseFloat( mtr_rows[tr][3])*Bfactor ] );
thru.push( [ xtime, parseFloat( mtr_rows[tr][5])*bfactor ] );
}
});
thru_avg=thru.pop();
......@@ -116,7 +125,7 @@ function make_select( elm, url){
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 id=tr_host value="" placeholder="my host" title="Automatisk utfylling av målepålenavn"></input>';
html+=' for <input id=tr_times value=10 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+=', report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.';
html+='</form>';
......
......@@ -39,7 +39,7 @@ if ( $q->http('HTTP_X_TOKEN') ne "virre-virre-vapp"){
$nobs = 3 if $nobs < 1;
$psize = 64 if $psize < 1;
$interval= 0.1 if $interval <= 0;
my $cmd= "/usr/bin/iperf -i $interval -t $nobs -c $host";
my $cmd= "/usr/local/bin/iperf3 -i $interval -t $nobs -c $host";
# open MTR, $cmd || die "Could not open : $cmd : $!";
......@@ -53,7 +53,7 @@ if ( $q->http('HTTP_X_TOKEN') ne "virre-virre-vapp"){
#while(<MTR>){
foreach ( split(/\n/, $mtr) ){
s/^\s+//; # leading blanks
s/\[\s+/[/; s/-\s+/-/;
s/\[\s+/[/; s/-\s+/-/; # blanks after left bracket
@F = split( /\s+/ );
push( @mtr, [@F] );
}
......
<!-- <table border=0 width=100%><tr><td> -->
<style type="text/css" title="currentStyle">
a {
text-decoration:underline;
}
</style>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-collapse collapse">
<ul id="menu" class='nav navbar'>
<li><a href="/">Oversikt</a></li>
<li><a href="/yt/">Yt</a></li>
<li><a href="/nettvei/">Nettvei</a></li>
<li><a href="/nettvei/">Rute</a></li>
<li><a href="/iperf/">Iperf</a>
<!-- ndt discontinued due kernel tcp problems
<li><a href="/ndt/">NDT</a></li>
......
......@@ -13,12 +13,24 @@ function make_select( elm, url){
var request=$.ajax( {url: url, type: 'GET', dataType: 'json', crossDomain: true } );
request.done( function( mps){
// console.log(mps);
$.each(mps, function(mp) {
html+='<option value="http://' + mps[mp].navn + '">' + mps[mp].navn + '</option>';
mp_list.push(mps[mp].navn);
});
mps.sort( function(a, b) {
var textA = a.navn.toLowerCase();
var textB = b.navn.toLowerCase();
if (textA < textB)
return -1;
if (textA > textB)
return 1;
return 0;
});
$.each(mps, function(mp) {
html+='<option value="http://' + mps[mp].navn + '">' + mps[mp].navn + '</option>';
mp_list.push(mps[mp].navn);
});
document.getElementById(elm).innerHTML += html + '</select></form>';
$( "#mp_name" ).autocomplete({ source: mp_list });
// $(#mp-name).select2();
});
request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
......@@ -33,7 +45,7 @@ function make_select( elm, url){
</script>
<script>
// $("#body-bs").prepend('<h1>Velkommen til målepålen ' + location.hostname + ' !</h1>');
$("#body-bs").prepend('<h1>Velkommen til målepålen ' + location.hostname + ' !</h1>');
</script>
<p class="info">
......
......@@ -6,7 +6,10 @@ include "php-felles/uninetttopp.php3";
?>
<link rel="shortcut icon" href="uninett-theme/ico/favicon.ico">
<script type="text/javascript" src="/js/jquery-ui-1.10.3/jquery-1.9.1.js"></script>
<!--
<link href="/js/select2/select2.css" rel="stylesheet"/>
<script type="text/javascript" src="/js/select2/select2.js"></script>
-->
<div id=body-bs></div>
<script>
$('#top-menu').load("/top-menu-bs.html");
......
......@@ -7,7 +7,7 @@
<script type="text/javascript" src="/js/Highcharts/js/highcharts.js"></script>
<!-- <script type="text/javascript" src=Highcharts/js/modules/exporting.js></script> -->
<!-- <script type="text/javascript" data-main="main" src="/js/require.js"></script> -->
<link rel="stylesheet" type="text/css" media="all" href="/style/mp-style.css" />
<!-- <link rel="stylesheet" type="text/css" media="all" href="/style/mp-style.css" /> -->
<style type="text/css" title="currentStyle">
@import "/js/jquery-ui-1.10.3/themes/base/jquery-ui.css";
......
......@@ -54,6 +54,9 @@ if ( $q->http('HTTP_X_TOKEN') ne "virre-virre-vapp"){
foreach ( split(/\n/, $mtr) ){
s/^\s+//; # leading blanks
@F = split( /\s+/ );
if ($F[0] = /(\d+)[^\d]+/){
$F[0]=$1;
}
push( @mtr, [@F] );
}
}
......
Subproject commit 0e361c73abdc2da9567c6baff711b8d230d3dba3
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<div class="col-lg-12 gutter uninett-padded uninett-color-lightGreen">
<!--
<h2>Simple web throughput test</h2>
-->
<div class="col-lg-12 gutter uninett-padded uninett-color-lightBlue">
<h2>Yt - Simple web throughput test</h2>
<table><tr><td>
<button class="btn btn-primary btn-lg" id="test" onclick="test_performance()">Test throughput!</button>
<!--
at about <td><form name="speedtest" id="speedform">
<select class="btn btn-basic btn-lg" name="speed_sel" id="speed_sel">
<option value="0">1-5 sec</option>
<option value="100k">100 Kbit/s</option>
<option value="1M">1 Mbit/s</option>
<option value="10M">10 Mbit/s</option>
......@@ -13,6 +14,7 @@ at about <td><form name="speedtest" id="speedform">
<option value="1G">1 Gbit/s</option>
</select>
</form>
-->
<td>to <span id=host></span>
<script>$("#host").html(document.location.hostname);
......@@ -59,18 +61,16 @@ at about <td><form name="speedtest" id="speedform">
<!--
<h3>Advanced</h3>
-->
<div class="uninett-color-grey uninett-padded gutter">
<div class="uninett-color-white uninett-padded gutter">
<p>The measurements will show you ballpark figures and no analysis. If you want a
more indepth and accurate measurement go to the
<span id=advanced></span>
<script>$("#advanced").html('<a class="btn btn-primary btn-lg" href="http://' + document.location.hostname + '/iperf/">Advanced throughput test</a>');</script>
</div>
<div class="uninett-color-white uninett-padded gutter">
<h3>About</h3>
<p>This test transfers files at 25 Kbytes to 25 Mbytes depending on the choice of speed.<br>
It should take about 2 seconds if the chosen speed is right.
<p>This test transfers files to and from the server increasing from 25 Kbytes to 25 Mbytes by a factor of 10 until it lasts 0.5-5 seconds.<br>
<!-- It should take about 2 seconds if the chosen speed is right. -->
<p>
<b>Transfer time</b> column show transfer time in seconds.<br>
<b>Mbit/s</b> column show the throughput i megabits per second computed as the web file transfer size by time.<br>
......
......@@ -16,7 +16,7 @@
<body>
<?php include '../body-bs.html'?>
<script>
$("#title-bs").html('Throughput test'); // title
$("#title-bs").html('Mleple'); // title
$('#top-menu-bs').load("/top-menu-bs.html");
$('#body-bs').load("jsbandwidth-body.html", // main body content
function(responseText, textStatus, XMLHttpRequest){
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment