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

Roppola, Antti - BRS Antti.Roppola at brs.gov.au
Thu Mar 27 00:12:37 GMT 2008


It depends on what aspects of the performance you want to instrument.

Assuming that you are concerned about performance internal to the page
(say a call to a database), you could very easily put some time markers
out of sight inside a PHP version of the page. I use this all the time
to troubleshoot more complex pages. This won't help with someone else's
site.

This approach would not get you externalities like the time to invoke
PHP and read/parse
your page code. Measuring from the browser side (or using wget) also
adds things like network
latency which you may (or may not) be interested in. We get slightly
different response
times via our private link to our DMZ versus Joe Public's external link;
a loopback wget
is really fast. (make sure you're not accidentally measuring cache
response!)

I have run Apache through Valgrind, that'd have to be close to the
ultimate
for instrumenting your web apps.

Viz, measurement is relative to where you measure from.

Antti

-----Original Message-----
From: linux-bounces+antti.roppola=brs.gov.au at lists.samba.org
[mailto:linux-bounces+antti.roppola=brs.gov.au at lists.samba.org] On
Behalf Of Tim Murphy
Sent: Thursday, 27 March 2008 10:42 AM
To: 'Keith Goggin'; linux at lists.samba.org
Subject: RE: [clug] A script to measure time to load a web page

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
Goggin
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

Hi,

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
page. 
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.


#!/bin/bash
START=$(date +%s)

./webpage.sh

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


#!/usr/bin/expect
#The browser 'Links' loads a major web page and should not quit until an
"OK" 
#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\ http://www.abc.net.au/news
expect "OK"
send "^C"
exit



-- 
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux

-- 
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux

------IMPORTANT - This message has been issued by The Department of Agriculture, Fisheries and Forestry (DAFF). The information transmitted is for the use of the intended recipient only and may contain confidential and/or legally privileged material. It is your responsibility to check any attachments for viruses and defects before opening or sending them on. 

Any reproduction, publication, communication, re-transmission, disclosure, dissemination or other use of the information contained in this e-mail by persons or entities other than the intended recipient is prohibited. The taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error please notify the sender and delete all copies of this transmission together with any attachments. If you have received this e-mail as part of a valid mailing list and no longer want to receive a message such as this one advise the sender by return e-mail accordingly. Only e-mail correspondence which includes this footer, has been authorised by DAFF 
------


More information about the linux mailing list