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)的更多相关文章

  1. mysql性能分析-------profiling和explain

    1. profiling之性能分析 MySQL5.0.37版本以上支持了Profiling – 官方手册.此工具可用来查询 SQL 会执行多少时间,System lock和Table lock 花多少 ...

  2. MySQL性能分析工具之PROFILE

    Mysql Profile 如何开启Profiles功能以及如何简单使用: https://www.cnblogs.com/zengkefu/p/6519010.html MySQL profiles ...

  3. 数据库性能分析 慢查询 profile工具

  4. SQL优化之慢查询和explain以及性能分析

    性能优化的思路 首先需要使用慢查询功能,去获取所有查询时间比较长的SQL语句 使用explain去查看该sql的执行计划 使用show profile去查看该sql执行时的性能问题 MySQL性能优化 ...

  5. CLR Profiler 性能分析工具 (转)

    原文地址:http://www.cnblogs.com/kevinlzf/archive/2010/11/12/1876066.html 下载地址:http://www.microsoft.com/e ...

  6. mysql性能分析show profile/show profiles

    MySQL性能分析show profiles show profile 和 show profiles 语句可以展示当前会话(退出session后,profiling重置为0) 中执行语句的资源使用情 ...

  7. 使用 profile 进行python代码性能分析

    定位程序性能瓶颈 对代码优化的前提是需要了解性能瓶颈在什么地方,程序运行的主要时间是消耗在哪里,对于比较复杂的代码可以借助一些工具来定位,python 内置了丰富的性能分析工具,如 profile,c ...

  8. Python性能分析工具Profile

    Python性能分析工具Profile 代码优化的前提是需要了解性能瓶颈在什么地方,程序运行的主要时间是消耗在哪里,对于比较复杂的代码可以借助一些工具来定位,python 内置了丰富的性能分析工具,如 ...

  9. 性能分析之profiling及火焰图

    profiling 是一项非常重要的,但又对很多程序员陌生的技术,它尤其对性能调优有显著帮助.本文以Brendan对perf的介绍稍加引入[底层涉及了太多细节,目前仅关心如何用它对服务器应用进行use ...

随机推荐

  1. m大子段和 hdu1024

    给出n个数,m个区间: 求选区m个区间的最大值: #include<cstdio> #include<algorithm> #include<math.h> #in ...

  2. 浅谈分治 —— 洛谷P1228 地毯填补问题 题解

    如果想看原题网址的话请点击这里:地毯填补问题 原题: 题目描述 相传在一个古老的阿拉伯国家里,有一座宫殿.宫殿里有个四四方方的格子迷宫,国王选择驸马的方法非常特殊,也非常简单:公主就站在其中一个方格子 ...

  3. 基于jenkins自动打包并部署docker环境及PHP环境

  4. 理解ASP.NET Core验证模型 Claim, ClaimsIdentity, ClaimsPrincipal

    Claim, ClaimsIdentity, ClaimsPrincipal: Claim:姓名:xxx,领证日期:xxx ClaimsIdentity:身份证/驾照 ClaimsPrincipal: ...

  5. 使用keil5(MDK)软件的一些记录

    1.如何快速找到相关函数 2.写程序时,换行时,如何使光标自动与上一行的代码自动对齐

  6. 攻防世界 你知道什么是cookie吗?

    打开题目链接,提示我们查看cookie,cookie是HTTP协议中的一个重要参数,(对HTTP协议不是很熟悉的friends可以看看这个“HTTP协议其实就是这么简单”) 查看cookie的方法有很 ...

  7. Ethereum Learning Materials

    Home 注:本页为 EthFans 站内文章精选集.鉴于文章的采集范围较广,我们无法保证文章内容没有重复,也不能保证排列的顺序实现了最优的认识路径.我们只能说,这些文章是我们精挑细选后,确认可以长期 ...

  8. Flex布局如何实现最后一个元素右对齐(CSS)

    在最后一项元素使用样式: margin-left: auto;

  9. 【PAT甲级】1082 Read Number in Chinese (25 分)

    题意: 输入一个九位整数,输出它的汉字读法(用拼音表示). trick: 字符串数组""其实会输出一个空格,而不是什么都不输出,导致测试点0和4格式错误. AAAAAccepted ...

  10. min-25筛总结

    怕忘了赶快更一下.就是求积性函数前缀和的. 没有 \(\LaTeX\) 原理 现在你有一个积性函数 f(1)=1 FP(p) FPK(p,k) 首先要求的是前缀和,那就是f(质数)+f(合数)+f(1 ...