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. AcWing 869. 试除法求约数

    #include <iostream> #include <algorithm> #include <vector> using namespace std; ve ...

  2. Hibernate第三天-Hibernate主配置信息

    今天是学习Hibernate的第三天,主要分析一下Hibernate的配置文件中的信息 Hibernate中的配置文件有两种,第一种是主配置文件hibernate.cfg.xml,第二种是映射配置文件 ...

  3. Java - Test - TestNG: testng.xml 元素 group

    1. 概述 group 相关的元素 groups run 其他相关(不准备提了) package class include exclude 2. 背景 准备 了解了 class 及其子元素 问题 对 ...

  4. 排序:ORDER BY

    1.按照字段值进行排序: 语法:order by 字段 升序|降序 (asc|desc) 默认情况下为“升序” asc.asc=ascending 升 desc=descending 降 2.允许多字 ...

  5. JEECG用户录入时用户账号长度修改

    JEECG用户账号默认长度为10字符,但实际运用中很大可能大于10字符. 解决方法: 1.找到\webpage\system\user\user.jsp文件 <input id="us ...

  6. 刷题10. Regular Expression Matching

    一.题目说明 这个题目是10. Regular Expression Matching,乍一看不是很难. 但我实现提交后,总是报错.不得已查看了答案. 二.我的做法 我的实现,最大的问题在于对.*的处 ...

  7. Apache和Nginx配置默认访问index.php

    Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d R ...

  8. js把树形数据转成扁平数据

    我就直接上代码了都是实际项目里面用到的 1.假设这个json就已经是树型结构数据了(如果不知道怎么实现树型结构数据请看我另一篇博客) var compressedArr=afcommon.treeDa ...

  9. Ubuntu mysql 在线安装

    $ sudo apt install mysql-server

  10. java语法基础--动手动脑问题及课后实验问题

    ---恢复内容开始--- 动手动脑: 1:仔细阅读示例:EnumTest.java,运行它,分析运行结果 结果 :枚举类型是引用类型!枚举类型不属于原始数据类型,它的每个具体指都引用一个特定的对象.相 ...