zoukankan      html  css  js  c++  java
  • Flask

    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()
    
  • 相关阅读:
    DHCP脚本
    7.31
    7.30
    7.26
    7.24
    VLAN与三层交换机
    静态路由配置
    7.17
    四次挥手
    TCP三次握手,四次挥手
  • 原文地址:https://www.cnblogs.com/allen2333/p/9150579.html
Copyright © 2011-2022 走看看