Flask - 性能分析(Profiling,profiler,profile)
1. 疑问
@app.cli.command()
@click.option('--length', default=25,
help='Number of functions to include in the profiler report.')
@click.option('--profile-dir', default=None,
help='Directory where profiler data files are saved.')
def profile(length, profile_dir):
"""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(debug=False)
flask web狗书的 git reset --hard 16b
flask profile --profile-dir="./profile",生成了后缀为*.prof的文件,我怎么查看这些文件呢?
我发起了一个issue:https://github.com/miguelgrinberg/flasky/issues/365
2. 解决
import sys
from pstats import Stats
my_stat = Stats('file.name', stream=sys.stdout)
my_stat.print_stats()
Flask - 性能分析(Profiling,profiler,profile)的更多相关文章
- mysql性能分析-------profiling和explain
1. profiling之性能分析 MySQL5.0.37版本以上支持了Profiling – 官方手册.此工具可用来查询 SQL 会执行多少时间,System lock和Table lock 花多少 ...
- MySQL性能分析工具之PROFILE
Mysql Profile 如何开启Profiles功能以及如何简单使用: https://www.cnblogs.com/zengkefu/p/6519010.html MySQL profiles ...
- 数据库性能分析 慢查询 profile工具
- SQL优化之慢查询和explain以及性能分析
性能优化的思路 首先需要使用慢查询功能,去获取所有查询时间比较长的SQL语句 使用explain去查看该sql的执行计划 使用show profile去查看该sql执行时的性能问题 MySQL性能优化 ...
- CLR Profiler 性能分析工具 (转)
原文地址:http://www.cnblogs.com/kevinlzf/archive/2010/11/12/1876066.html 下载地址:http://www.microsoft.com/e ...
- mysql性能分析show profile/show profiles
MySQL性能分析show profiles show profile 和 show profiles 语句可以展示当前会话(退出session后,profiling重置为0) 中执行语句的资源使用情 ...
- 使用 profile 进行python代码性能分析
定位程序性能瓶颈 对代码优化的前提是需要了解性能瓶颈在什么地方,程序运行的主要时间是消耗在哪里,对于比较复杂的代码可以借助一些工具来定位,python 内置了丰富的性能分析工具,如 profile,c ...
- Python性能分析工具Profile
Python性能分析工具Profile 代码优化的前提是需要了解性能瓶颈在什么地方,程序运行的主要时间是消耗在哪里,对于比较复杂的代码可以借助一些工具来定位,python 内置了丰富的性能分析工具,如 ...
- 性能分析之profiling及火焰图
profiling 是一项非常重要的,但又对很多程序员陌生的技术,它尤其对性能调优有显著帮助.本文以Brendan对perf的介绍稍加引入[底层涉及了太多细节,目前仅关心如何用它对服务器应用进行use ...
随机推荐
- Qt入门-表格类QTableWidget
原文 :http://blog.csdn.net/xgbing/article/details/7774737 表格是GUI中常用的控件,在Qt中,常用的表格类是QTableWidget. 示例: Q ...
- bugku web 5
首先进入网站http://123.206.87.240:8002/web5/index.php 进入之后就会看到 然后点击F12就会打开后台 然后就会发现有一串东西就是这个然后经过搜索是jsfuck ...
- CDH仅完成 0/3 个步骤。首个失败:主机 node6 (id=2) 上的客户端配置 (id=1) 已使用 1 退出,而预期值为 0。
CDH仅完成 0/3 个步骤.首个失败:主机 node6 (id=2) 上的客户端配置 (id=1) 已使用 1 退出,而预期值为 0 javaHome出现了问题 JAVA_HOME并不是根据环境 ...
- AcWing 859. Kruskal算法求最小生成树 稠密图
//稠密图 #include <cstring> #include <iostream> #include <algorithm> using namespace ...
- python+pygame制作一个可自定义的动态时钟和详解
1.效果图 2.完整代码 #第1步:导出模块 import sys, random, math, pygame from pygame.locals import * from datetime im ...
- mysql 慢查询日志 (mysqldumpslow坑还没填)
MySQL的慢查询日志是MySQL提供的一种日志记录,用来记录在MySQL中响应时间超过long_query_time值的SQL语句(秒为单位). 默认情况下MySql数据库没有开启慢查询日志, my ...
- 记一道简单的re--BUUctf reverse1
1.首先拖进ida里,看到了左面一百多function...还是shift+f12 查看敏感字符串吧 2.发现了这两个比较可疑的字符串,然后双击this is the right flag 进入到了他 ...
- 用Fiddler实现手机抓包
手机用fiddler抓包 电脑最好是笔记本,这样能和手机保持统一局域网内:其他不多说,直接说步骤了. 一.对PC(笔记本)参数进行配置 1. 配置fiddler允许监听到https(fiddle ...
- 根据IP地址查找MAC地址
ping 地址 arp -a得到ip对应的mac
- 时间戳,日期,string互转
import timeimport datetimeimport operatordef makeStamp(y,m,d,format='%Y-%m-%d'): """m ...