
cherokee at cherokee-project
Jul 6, 2009, 3:40 AM
Post #1 of 1
(254 views)
Permalink
|
|
[3425] stressing: Print elapse time on error
|
|
Revision: 3425 http://svn.cherokee-project.com/changeset/3425 Author: alo Date: 2009-07-06 12:40:36 +0200 (Mon, 06 Jul 2009) Log Message: ----------- Print elapse time on error Modified Paths: -------------- stressing/README.txt stressing/requester.py Modified: stressing/README.txt =================================================================== --- stressing/README.txt 2009-07-05 08:11:47 UTC (rev 3424) +++ stressing/README.txt 2009-07-06 10:40:36 UTC (rev 3425) @@ -4,8 +4,8 @@ - Copy config.sample.py to config.py. Edit it in order to adapt it to your needs and environment. - Remember to use host names. Do NOT use local-loop addresses of any - kind (localhost, ::1, 127.0.0.1). + Remember to use public host names. Do NOT use local-loop addresses + of any kind (localhost, ::1, 127.0.0.1). - Choose the type of test you will perform, and generate the testing set. For instance: static/generate.py Modified: stressing/requester.py =================================================================== --- stressing/requester.py 2009-07-05 08:11:47 UTC (rev 3424) +++ stressing/requester.py 2009-07-06 10:40:36 UTC (rev 3425) @@ -41,11 +41,16 @@ c.setopt (pycurl.SSL_VERIFYHOST, 0); c.setopt (pycurl.URL, url) try: + c.requested_time = time.time() c.perform() except pycurl.error, e: if verbose: errno, text = e - print "ERROR: %s: %s" % (text, url) + elapse = c.requested_time - time.time() + print "ERROR(%d) %s" % (errors, text) + print " URL = %s" % (url) + if elapse >= 0.01: + print " Elapse = %.02f secs" % (elapse) errors += 1 time.sleep(1) continue
|