通过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第三方库


热门话题
java我想将gridview更改为recyclerview   java将信息发送到电子邮件   Regex java用于检查开始[和结束],但可以在开始和结束处\t\r\n   java ActionListener代理wierd   java Dagger 2单例不工作   java Spring AntRequestMatcher不匹配   由于java,安卓无法运行gradle测试任务。lang.NoClassDefFoundError:jdk/internal/reflect/GeneratedSerializationConstructorAccessor1   java如何修复com。fasterxml。杰克逊。数据绑定。JsonMappingException:反序列化属性时出现问题“错误”   java NavigationDrawer的菜单不工作   声明“不兼容类型:类无法转换为数组”的java错误   java“在每个项目中创建名为“entityManagerFactory”且在类路径资源中定义的bean时出错”   java JTextField和JLabel未出现   macos从OSX上的Java程序保存PNG   java mxGraph编辑器拖动节点克隆?   java在JPanel上绘制并将JPanel添加到JFrame   java不获取web应用程序SpringMVC+jpa+postgreSQL中的所有用户对象