MessageTally spyOn: ?

Jimmie Houchin jhouchin at texoma.net
Thu Feb 20 05:58:59 UTC 2003


Hello,

Below is a modified version of Avi's code which is reading a file (25k) 
from a directory and storing it's contents into a variable and serving 
it. On my 700mhz Athlon Debian system I am getting over 800 request per 
second on this. :)

Also how would you profile the below code?
I used MessageTally spyOn:  with the block around the 'output' and 'start.'.

It only ran once at the beginning and stopped profiling. :(
I would like something to profile as I 'ab' test the code.
Any help greatly appreciated.


|output listener rfile fname fdir |
fdir := FileDirectory default fullName.
fname := fdir, '/hello25k.html'.
rfile := FileStream readOnlyFileNamed: fname.
rfile := rfile contentsOfEntireFile.

output _( 'HTTP/1.0 200 OK\Content-Type: text/html\\',rfile contents) 
withCRs withInternetLineEndings.
listener _ ConnectionHandler
           onPort: 8000
           handler: [:s | s getData; sendData: output; closeAndDestroy]
           priority: Processor highIOPriority.
listener start.


Thanks,

Jimmie Houchin



More information about the Squeak-dev mailing list