[clug] A script to measure time to load a web page

Tim Murphy tim at murphy.org
Wed Mar 26 23:42:14 GMT 2008

What about running command line PHP with an include to the file?

You could then measure the execution time of the call.

Dirty and primitive but it works.

-----Original Message-----
From: linux-bounces+tim=murphy.org at lists.samba.org
[mailto:linux-bounces+tim=murphy.org at lists.samba.org] On Behalf Of Keith
Sent: Wednesday, 26 March 2008 10:52 PM
To: linux at lists.samba.org
Subject: [clug] A script to measure time to load a web page


I need to record the time it takes to load a web page at different times of
the day, for example hourly for 24 hours.

So far I have a script which spawns a browser and starts to load the web
But I can't make it wait until the page is fully loaded before it returns to
the calling script which reports the elapsed time.

I have no experience with bash scripting and may well be on the wrong track
so any help would be much appreciated.

START=$(date +%s)


END=$(date +%s)
DIFF=$(( $END - $START ))
echo "task completed in $DIFF seconds @ `date +%r%d%b%Y`"\ 
>> /lindata/Benchmark/result

#The browser 'Links' loads a major web page and should not quit until an
#has been received.
#Graphical mode & java-script is enabled. Caching is set to zero.

spawn /usr/bin/links -g -enable-javascript 1 -format-cache-size\ 
0 -memory-cache-size 0 -image-cache-size 0\
expect "OK"
send "^C"

linux mailing list
linux at lists.samba.org

More information about the linux mailing list