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 ...
随机推荐
- easy-rules
我们在写业务代码经常遇到需要一大堆if/else,会导致代码可读性大大降低,有没有一种方法可以避免代码中出现大量的判断语句呢?答案是用规则引擎,但是传统的规则引擎都比较重,比如开源的Drools,不适 ...
- 交换机的MAC地址?
该示例中记录了Cat2960的MAC地址情况: Cat2960#sho mac address-table Mac Address Table----------------------------- ...
- Bug搬运工-CSCvg37458:ISR4K goes into booting loop with "flash:" in boot statement
ISR4K升级的时候要注意了! 很可能会碰到如下的问题: ISR4K goes into booting loop with "flash:" in boot statement ...
- RPA_播放语音
验证码识别 from rpa.captcha.captcha import Captcha c = Captcha() log.info(tmp_file_path) captcha_result = ...
- VIM - EX 命令 - 文件读写
VIM - EX 命令 - 文件读写 1. 概述 vim 通过 ex 命令行, 与其他文件的读写操作 2. 场景 场景1 vim 打开文本 将当前文本的内容, 写入到其他文本 场景2 vim 打开文本 ...
- 洛谷 P2709 小B的询问(莫队)
题目链接:https://www.luogu.com.cn/problem/P2709 这道题是模板莫队,然后$i$在$[l,r]$区间内的个数就是$vis[ ]$数组 $add()$和$del()$ ...
- VS2017新建或拷贝项目编译时出现:找不到 Windows SDK 版本8.1.请安装所需的版本的 Windows SDK
VS2017新建或拷贝项目编译时出现:找不到 Windows SDK 版本8.1.请安装所需的版本的 Windows SDK 或者在项目属性页的问题解决方案 解决方法: 右击项目解决方案, 选择:重定 ...
- Python 高级特性介绍 - 迭代的99种姿势 与协程
Python 高级特性介绍 - 迭代的99种姿势 与协程 引言 写这个笔记记录一下一点点收获 测试环境版本: Python 3.7.4 (default, Sep 28 2019, 16:39:19) ...
- if语句的汇编表示
转自:https://blog.csdn.net/u011608357/article/details/22586137 demo: C语言: int max(int x,int y) { if (x ...
- 关于iOS appIcon launchImage 尺寸
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix ...