Skip to content

Commit

Permalink
integrated profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
ehenneken committed Aug 16, 2016
1 parent 18c2e3d commit 7835c24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -1,3 +1,7 @@
### 1.0.14

* add profiling command to manage.py

### 1.0.13

* removed Consul dependencies
Expand Down
8 changes: 8 additions & 0 deletions service/manage.py
Expand Up @@ -16,5 +16,13 @@

manager.add_command('db', MigrateCommand)

@manager.command
def profile(length=25, profile_dir=None):
"""Start the application under the code profiler."""
from werkzeug.contrib.profiler import ProfilerMiddleware
app_.wsgi_app = ProfilerMiddleware(app_.wsgi_app, restrictions=[length],
profile_dir=profile_dir)
app_.run()

if __name__ == '__main__':
manager.run()

0 comments on commit 7835c24

Please sign in to comment.