Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
d612fc84
Commit
d612fc84
authored
Jun 18, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug: new example to run the profiler for 1 minute
parent
a992f21a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
neo/debug.py
neo/debug.py
+14
-0
No files found.
neo/debug.py
View file @
d612fc84
...
...
@@ -164,3 +164,17 @@ elif IF == 'frames':
write
(
"Thread %s:
\
n
"
%
thread_id
)
traceback
.
print_stack
(
frame
)
write
(
"End of dump
\
n
"
)
elif
IF
==
'profile'
:
DURATION
=
60
def
stop
(
prof
,
path
):
prof
.
disable
()
prof
.
dump_stats
(
path
)
@
defer
def
profile
(
app
):
import
cProfile
,
threading
,
time
from
.lib.protocol
import
uuid_str
path
=
'neo-%s-%s.prof'
%
(
uuid_str
(
app
.
uuid
),
time
.
time
())
prof
=
cProfile
.
Profile
()
threading
.
Timer
(
DURATION
,
stop
,
(
prof
,
path
)).
start
()
prof
.
enable
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment