MCPcopy Create free account
hub / github.com/dianping/cat / func

Function func

lib/python/test/test_all.py:13–19  ·  view source on GitHub ↗
(method, args)

Source from the content-addressed store, hash-verified

11
12
13def 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")

Callers 4

serveFunction · 0.70
wrapsFunction · 0.70
wrapsFunction · 0.50
wrapsFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected