Chapter 4. Web Performance Tester
So far, the programs we've written have been useful, but they've shared one main limitation — they are largely self contained, intended to be run on a single computer (although the database program could certainly have a database housed on another computer). Our next program will change that.
The Web Performance Tester has two main functions (I use "function" in the generic sense here):
It will use Python's
urllib2module to emulate a web browser, access several well-known web sites, and report the amount of time it took to get back the HTML from the page accessed. It will also write its results to a log file, which can be accessed later.It will communicate with a simple
Pythonweb server on another machine on the computer's internal network, download a text file and a binary file (through HTTP), and report the results. It will record the results in alogfile.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access