Last change
on this file since 14119 was
8692,
checked in by uli, 13 years ago
|
Use the second URL when running in ZEO mode.
|
File size:
620 bytes
|
Rev | Line | |
---|
[8654] | 1 | import mechanize |
---|
| 2 | import time |
---|
[8692] | 3 | from config import register_url, register_url2 |
---|
[8654] | 4 | |
---|
| 5 | class Transaction(object): |
---|
| 6 | def __init__(self): |
---|
| 7 | pass |
---|
| 8 | |
---|
| 9 | def run(self): |
---|
| 10 | b = mechanize.Browser() |
---|
| 11 | b.set_handle_robots(False) |
---|
| 12 | start_time = time.time() |
---|
[8692] | 13 | resp = b.open(register_url2) |
---|
[8654] | 14 | content = resp.read() |
---|
| 15 | latency = time.time() - start_time |
---|
| 16 | self.custom_timers['Load_Registration_Page'] = latency |
---|
| 17 | assert (resp.code == 200), 'Bad Response: HTTP %s' % resp.code |
---|
| 18 | return |
---|
| 19 | |
---|
| 20 | if __name__ == '__main__': |
---|
| 21 | trans = Transaction() |
---|
| 22 | trans.run() |
---|
| 23 | print trans.custom_timers |
---|
Note: See
TracBrowser for help on using the repository browser.