Do you have another machine you can use? Basically, use FTP and a command file (see 'man ftp') to upload/download a semi-large file. You can then use grep to grab your upload/download speeds.
Once you have those, what you do with them is up to you. I'd suggest RRDTool, though it's interface can be a bit confusing.
I've done this before, here's some PHP code that I used. The ftp1.optonline.net link probably isn't helpful to you, you basically just need to find a large file on a http/ftp server.
$c = curl_init('ftp://ftp1.optonline.net/test4');
echo "Down: ".curl_getinfo($c,CURLINFO_SPEED_DOWNLOAD)."\n";
$down = curl_getinfo($c,CURLINFO_SPEED_DOWNLOAD);
exec('dd if=/dev/urandom of=/tmp/speedup bs=1024 count=1024');
$u = curl_init('ftp://your_ftp_server');
echo "Up: ".curl_getinfo($u,CURLINFO_SPEED_UPLOAD)."\n";
$up = curl_getinfo($u,CURLINFO_SPEED_UPLOAD);
$f = fopen("/tmp/speed_data.txt","a");
fwrite($f,mktime()." $down $up\n");