通过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和Javascript之间共享常量   c#无法使用Gson反序列化字节[]   如果字符串是实十进制数字,则在Java中仅显示十进制数字   与Android Studio的java FireBase同步失败   web应用程序的Java Oracle数据库更改通知问题   数组中缺少整数的java嵌套循环   zos在z/os上以TOD格式(一天中的时间)转换Java时间戳   java JAXB未根据注释生成XML(JDK 1.7)   java使用Twitter4j和Geolocation查找在该地区发布推文的用户,但如何获取用户ID?   在Libgdx中实现简单运动模糊的java意外结果   java在Android数据库中插入另一个EditText值?   java标准偏差数组(我的算法错误)   java如何修复M1 Mac的Ant javascript标记?   java遍历树标记值的长度   java理解Springboot中的Cron,自动发送电子邮件   java如何将“Data.Json”文件从资产保存到内部存储器,然后将其用于读/写   java代码在编写FirstDuplicate方法时会遇到时间限制问题   java将HTML转换为PDF并将其添加到段落中   javascript css()未设置正文标记的背景属性