(method, args)
| 11 | |
| 12 | |
| 13 | def func(method, args): |
| 14 | r = random.random() |
| 15 | # 5% of the requests will raise exception |
| 16 | if r < 0.95: |
| 17 | time.sleep(random.random() / 100) |
| 18 | else: |
| 19 | raise Exception("something wrong!") |
| 20 | |
| 21 | |
| 22 | @cat.transaction("rpc", "server") |