Profile a Tornado application through a REST API
Add this library to your routes to add a REST API for profiling your Tornado application.
Usage
import tornado
from tornado_profile import TornadoProfiler
port = 8888
routes = []
routes += TornadoProfiler().get_routes()
app = tornado.web.Application(routes)
app.listen(port)
tornado.ioloop.IOLoop.current().start()
# Create with optional route prefix and base class for handlers
routes += TornadoProfiler(prefix="", handler_base_class=custom_base_class).get_routes()
Installation
$ pip install tornado-profile
API
# Start the profiler
POST /profiler
# Stop the profiler
DELETE /profiler
# Get the profiler status
GET /profiler
{"running": true/false}
# Get the profiler statistics
GET /profiler/stats
{
"statistics": [
{
"path": ...,
"line": ...,
"func_name": ...,
"num_calls": ...,
"total_time": ...,
"total_time_per_call": ...,
"cum_time": ...,
"cum_time_per_call": ...
}
...
]
}
# Get the profiler statistics with optional query parameters
GET /profiler/stats?count=1&sort=num_calls&strip_dirs=false
# Clear the profiler statistics
DELETE /profiler/stats
Tools
Command Line: https://github.com/dimrozakis/tornado-profile-client
Metadata
Release files for tornado-profile 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tornado_profile-1.2.0-py2.7.egg | Legacy Egg format | - | - | Details |
| tornado_profile-1.2.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 13.3 kB
Release files / tornado_profile-1.2.0-py2.7.egg
| Download URL | tornado_profile-1.2.0-py2.7.egg |
|---|---|
| Size | 7.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
3459e2b034064a3652edcd3c6cd7fe6e3cdc6998ec61eebf0d940b600cdd7fb6
|
|
BLAKE2b-256 checksum How to use checksums |
a067209b18da417ee45a7053c4bc5b305a4d8ccdb7197da5e6abbafaf04bda81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tornado_profile-1.2.0-py2-none-any.whl
| Download URL | tornado_profile-1.2.0-py2-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
1051e3a792dc5845a1029ab23321ce53aedcc06a74f75af406670860fd6bf05e
|
|
BLAKE2b-256 checksum How to use checksums |
9659e61a6b5fef83c17fab008e56ad7fb6dbe46bac85e3bbd8bf0fece33cb03b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |