Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adds test directory and a test for direct attach calls

  • Loading branch information...
commit b3ca8231c804d6ddef452bae6f4fc92e44df5174 1 parent 0667e71
shaun authored
View
39 tests/attach.py
@@ -0,0 +1,39 @@
+
+import sys
+
+sys.path = ['.'] + sys.path
+
+import time
+import gevent
+import gevent_profiler
+from gevent import monkey
+
+def eat_up_cpu():
+ for x in range(100):
+ for y in range(100):
+ z = x * y
+
+def eat_up_some_more_cpu():
+ for x in range(100):
+ for y in range(100):
+ z = x * y
+
+def task():
+ time.sleep(3)
+ eat_up_cpu()
+ eat_up_some_more_cpu()
+ print "hi!"
+
+def main():
+ monkey.patch_all()
+
+ tasks = []
+
+ gevent_profiler.attach()
+ g = gevent.spawn(eat_up_cpu)
+ g.join()
+ gevent_profiler.detach()
+
+if __name__ == "__main__":
+ main()
+
View
0  attach_test.py → tests/attach_on_signal.py
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.