mò á¸Ec@sndkZdkZdkZdkZd„Zdadeifd„ƒYZdkZdfd„ƒYZ dkl Z l Z da dd „Z ed joÐeeiƒd jod eidGHqjeid \ZZZZZeieƒZeieƒZeieƒZe ƒZed„eeƒƒZe ƒeiƒZdeetetefGHdt GHndS(NcCs!tii|ƒtiiƒdS(N(tsyststdouttwritetthingtflush(R((tB/data/zmath/zope/lib/python/ZServer/medusa/test/asyn_http_bench.pytblurt sit http_clientcBsAtZddddd„Zd„Zd„Zd„Zd „ZRS( Ns 127.0.0.1iPt/i cCsjtii|ƒ|ititiƒ||_||_ ||_ ||_ d|_ |i ||fƒdS(Ni(tasyncoretdispatcher_with_sendt__init__tselft create_sockettsockettAF_INETt SOCK_STREAMthosttportturitnumtbytestconnect(R RRRR((RR s     cGsdS(N((R tinfo((RtlogscCs!d|_|id|iƒdS(NisGET %s HTTP/1.0 (R t connectedtsendR(R ((Rthandle_connects cCs)|idƒ}|it|ƒ|_dS(Ni (R trecvtdRtlen(R R((Rt handle_read"scCsI|iƒtda|io't|i|i|i|idƒndS(Ni(R tclosettotal_sessionsRRRRR(R ((Rt handle_close's    (t__name__t __module__R RRRR"(((RRs    ttimercBstZd„Zd„ZRS(NcCstiƒ|_dS(N(ttimeR tstart(R ((RR 1scCstiƒ|iS(N(R&R R'(R ((Rtend3s(R#R$R R((((RR%0s (s socket_mapspollf30.0cCs@x9to1ttƒtjottƒant|ƒqWdS(N(t socket_mapRtMAXtpollttimeout(R,((Rtloop:s t__main__is2usage: %s icCstttttdƒS(Ni(RRRRthits(tx((RtJssI %d clients %d hits/client total_hits:%d %.3f seconds total hits/sec:%.3fs&Max. number of concurrent sessions: %d(R RtstringRRR!R RR&R%R)R+R*R-R#RtargvRRRR/RtatoitttmaptrangetclientsR(t total_time(R RR+RR)RR9R2RRR/RR8RR%R5R&RR-((Rt?s0