Stores and visualizes internet Download and Upload Speed data graphically, without PUB. These scripts are based on https://github.com/sivel/speedtest-cli and http://dygraphs.com/download.html The project is ready to be an eclipse project (used on a mac computer) but you can just unzip it and use it as described below.
- A mysql database
- A web server
Create a mysql schema "ISPEED" and a table using:
CREATE TABLE log
(
timestamp
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
distance
float DEFAULT NULL COMMENT 'km',
testfrom
text,
hostedby
text,
ping
float DEFAULT NULL COMMENT 'msec ping time',
downloadspeed
float DEFAULT NULL COMMENT 'in Mbit/s',
uploadspeed
float DEFAULT NULL COMMENT 'in Mbit/s',
PRIMARY KEY (timestamp
)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Then add a user on ISPEED (SELECT, INSERT)
Install or take a web server (I took an apache web server), define a virtual server to contain a documentRoot=/path/to/speedtestweb/
<VirtualHost *:20000> ServerName cerere:20000 DocumentRoot "/Users/you/Documents/workspace/speedtest" ErrorLog /private/var/log/apache2/servername_20000_semweb.local.err TransferLog "/private/var/log/apache2/servername_20000_access.log"
<Directory "/path/to/speedtest">
Order allow,deny
Allow from all
AllowOverride All
Options +Indexes +FollowSymLinks +ExecCGI +Includes
Require all granted
</Directory>
$DB_HOST='127.0.0.1:3306';
$DB_UNAME='speeduser';
$DB_PWORD='the rightmysqlISPEEDpassword'; crontab to call the datasampler.php at reboot:
Add line in crontab -e
:
/usr/bin/php /path/to/speedtest/src/php/datasampler.php > /tmp/datasampler.log
Start the web server and call: http://yourwebserver/src/php/dataserver.php
http://yourwebserver/src/php/dataserver.php?last=100 http://yourwebserver/src/php/dataserver.php?last=200&reload=60 ![Alt Example of dataserver.php graphical output](https://github.com/redskate/speedtestweb/blob/master/images/picexample.png "Example of dataserver.php graphical output")