-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathapp.py
More file actions
45 lines (31 loc) · 703 Bytes
/
app.py
File metadata and controls
45 lines (31 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from __future__ import print_function
import random
import time
import sys
import threading
sys.path.append(".")
import stackimpact
agent = stackimpact.start(
agent_key = 'agent key here',
app_name = 'MyPythonApp',
auto_profiling = False)
agent.start_cpu_profiler()
for j in range(0, 1000000):
random.randint(1, 1000000)
agent.stop_cpu_profiler()
'''
agent.start_allocation_profiler()
mem1 = []
for i in range(0, 1000):
obj1 = {'v': random.randint(0, 1000000)}
mem1.append(obj1)
agent.stop_allocation_profiler()
'''
'''
agent.start_block_profiler()
def blocking_call():
time.sleep(0.1)
for i in range(5):
blocking_call()
agent.stop_block_profiler()
'''