通过rest配置龙卷风应用程序

tornado-profile的Python项目详细描述


https://travis-ci.org/makearl/tornado-profile.svg?branch=master

将此库添加到路由中,以添加用于分析tornado应用程序的rest api。

用法

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()

安装

$ 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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Linux的java字符串命令   java parseInt和viewflipper布局问题   java正则表达式来平衡括号   mysql与数据库的Java连接   java将JFreeChart系列名称映射到系列索引   多线程如何使用信号量在Java中对哲学家进行编码?   oop特殊变量“this”如何准确地知道在JAVA程序中引用哪个对象?   Android上的java getType   当前值/单元格POI上的java Excel公式   代码中有错误(java.awt.image.RasterFormatException)   java改造2,参数转换   未找到java JSF 2 Ajax属性   JAVArmi。服务器在OpenJDK 8中,useCodebaseOnly默认为true   java如何用final实现静态?   对付Java语法冗长的最佳IDE宏工具?   java@Transactional不回滚