Commit 3a120ccf authored by Olav Kvittem's avatar Olav Kvittem

multiple parallels parsing

parent 0dae347f
......@@ -8,6 +8,7 @@
# use CGI;
use CGI qw/:standard -debug/;
use JSON;
my $q = CGI->new;
print $q->header('application/json');
......
......@@ -65,7 +65,8 @@ at about <td><form name="speedtest" id="speedform">
<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>. Accuracy is best for lower speeds and lower for gigabit speeds.
<script>$("#advanced").html('<a class="btn btn-primary btn-lg" href="http://' + document.location.hostname + '/iperf/">Advanced Iperf throughput test</a>');</script>.
<p> The results will depend on browser, operating system and direction as well as the network card setup and local TCP buffer configuration. These factors influence increase with speed and accuracy is lower for gigabit than megabit speeds.
<h3>About</h3>
......
......@@ -227,7 +227,7 @@ function TestRoundTrip(){
function ResultsUpload(dlspeed, ulspeed, rtt){
$.ajax({
type: "POST",
url: "jsresult.php?start=" + start + '&dlspeed=' + dlspeed + '&ulspeed=' + ulspeed + '&webrtt=' + rtt,
url: "jsresult.php?system=jsbandwidth&start=" + start + '&dlspeed=' + dlspeed + '&ulspeed=' + ulspeed + '&webrtt=' + rtt,
success: function(data, textStatus, jqXHR) {
// alert( 'Stats upload: ' + data + " : " + textStatus);
},
......
<?php
// logs to syslog performance data from jsbandwidth
if ( ( time() - $_COOKIE["jsbandwidth-time"] ) > 1){ // only accept one per second
if ( is_numeric( $_REQUEST['dlspeed'] ) && is_numeric($_REQUEST['ulspeed']) && is_numeric($_REQUEST['webrtt']) ){
syslog(LOG_INFO, 'jsbandwidth normal' . ' dlspeed=' . $_REQUEST['dlspeed'] .' ulspeed=' . $_REQUEST['ulspeed']
. ' webrtt=' . $_REQUEST['webrtt'] . ' remote_address=' . $_SERVER['REMOTE_ADDR'] );
} else { // ignore ill formed requests
// syslog(LOG_WARNING, 'jsbandwidth error' . ' dlspeed=' . $_REQUEST['dlspeed'] .' ulspeed=' . $_REQUEST['ulspeed']
// . ' webrtt=' . $_REQUEST['webrtt']. ' remote_address=' . $_SERVER['REMOTE_ADDR']);
}
}
// if ( ( time() - $_COOKIE["jsbandwidth-time"] ) > 1){ // only accept one per second
if ( is_numeric( $_REQUEST['dlspeed'] ) && is_numeric($_REQUEST['ulspeed']) && is_numeric($_REQUEST['webrtt']) ){
openlog('MP-web', LOG_NDELAY , LOG_LOCAL0);
preg_replace( '/[;&$|]/i', "_", $_REQUEST['system']);
syslog(LOG_INFO, $_REQUEST['system'] . ' normal' . ' dlspeed=' . $_REQUEST['dlspeed'] .' ulspeed=' . $_REQUEST['ulspeed']
. ' webrtt=' . $_REQUEST['webrtt'] . ' remote_address=' . $_SERVER['REMOTE_ADDR'] );
} else { // ignore ill formed requests
// syslog(LOG_WARNING, 'jsbandwidth error' . ' dlspeed=' . $_REQUEST['dlspeed'] .' ulspeed=' . $_REQUEST['ulspeed']
// . ' webrtt=' . $_REQUEST['webrtt']. ' remote_address=' . $_SERVER['REMOTE_ADDR']);
}
// }
?>
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