FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pyt/profiling/profiler.py at 8githubScanRefactor · python-security/pyt · GitHub
python-security
pyt
Repository navigation
Code
Issues
26
(26)
Pull requests
2
(2)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pyt
/
profiling
/
profiler.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (28 loc) · 1.38 KB
Breadcrumbs
pyt
/
profiling
/
profiler.py
Copy path
File metadata and controls
38 lines (28 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
argparse
from
.
import
fine_timer
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'project_file'
,
help
=
'Path to the file where PyT should start to analyse.'
,
type
=
str
)
parser
.
add_argument
(
'-pr'
,
'--project'
,
help
=
'Path to where the project is located which PyT should analyse.'
,
type
=
str
)
parser
.
add_argument
(
'-n'
,
'--number-of-results'
,
help
=
'Number of results to be shown. Default: 10.'
,
type
=
int
)
parser
.
add_argument
(
'-v'
,
'--visualise'
,
help
=
'Visualise the results in an interactive way.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-fp'
,
'--fixed-point'
,
help
=
'Run line profiling on the fixed point algorithm.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-k'
,
'--keep-intermediate-files'
,
help
=
'Keep files from cProfile and the line profiler.'
,
action
=
'store_true'
)
args
=
parser
.
parse_args
()
number_of_results
=
10
if
args
.
number_of_results
:
number_of_results
=
args
.
number_of_results
fine_timer
.
run
(
args
.
project
,
args
.
project_file
,
number_of_results
)
if
args
.
fixed_point
:
fine_timer
.
fixed_point_timer
(
args
.
project
,
args
.
project_file
)
if
args
.
visualise
:
try
:
print
()
print
(
'#############################'
)
print
(
'C-c to to clean up and exit.'
)
print
(
'#############################'
)
print
()
fine_timer
.
visualise
()
except
KeyboardInterrupt
:
pass
if
not
args
.
keep_intermediate_files
:
fine_timer
.
clean_up
()
Back
|
FazBrowse Home
|
New Git URL