Skip to content

Commit c63b8e6

Browse files
committed
Add profiling script
1 parent 84cc47f commit c63b8e6

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ The application may be run locally with the following command.
2828
flask run -h localhost -p 8080
2929
```
3030

31+
### Profiling
32+
To profile selections, run
33+
```bash
34+
python prof.py
35+
```
36+
37+
This will setup the werzeug profiler, and output profiling results in logs for every request made.
38+
3139
## Code standards
3240
This project uses Pylint for linting and enforcement of code standards and styling.
3341
Every pull request of this project will be tested by Travis CI.

prof.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from werkzeug.middleware.profiler import ProfilerMiddleware
2+
from selections import app
3+
4+
app.config['PROFILE'] = True
5+
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30], sort_by=('cumtime',))
6+
app.run(debug = True)

0 commit comments

Comments
 (0)