Last change
on this file since 10019 was
8654,
checked in by uli, 13 years ago
|
Put local stresstest stuff into SVN. Yet not too useable!
|
File size:
604 bytes
|
Rev | Line | |
---|
[8654] | 1 | import mechanize |
---|
| 2 | import time |
---|
| 3 | from config import register_url |
---|
| 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() |
---|
| 13 | resp = b.open(register_url) |
---|
| 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.