flask-profiler, 监视端点调用并尝试进行某些分析的Flask 事件探查器

flask-profiler, 监视端点调用并尝试进行某些分析的Flask 事件探查器,第1张

概述源代码名称:flask-profiler 源代码网址:http://www.github.com/muatik/flask-profiler flask-profiler源代码文档 flask-profiler源代码下载 Git URL: 复制代码 git://www.github.com/muatik/flask-profiler.git Git Clone代码到本地: 复制代码 git clo 源代码名称:flask-profiler 源代码网址:http://www.github.com/muatik/flask-profiler flask-profiler源代码文档 flask-profiler源代码下载 Git URL:
git://www.github.com/muatik/flask-profiler.git
Git Clone代码到本地:
git clone http://www.github.com/muatik/flask-profiler
Subversion代码到本地:
$ svn co --depth empty http://www.github.com/muatik/flask-profilerChecked out revision 1.$ cd repo$ svn up trunk
  烧瓶分析器

版本:1.6

使用  profiler测量在你的Flask 应用程序中定义的端点;并通过web界面提供细粒度的报告。

它给出了这些问题的答案:

应用程序中的瓶颈在哪里? 应用程序中最慢的终结点? 哪些是最常被调用的终结点? 什么导致我的慢速端点? 在哪个上下文中,什么是 ARGS 和 kwargs? 特定请求花费了多少时间?

简而言之,如果你对端点正在做什么和接收的请求进行了了解,请尝试打瓶探查器。

通过使用烧瓶分析器接口,你可以监视所有端点的性能,并通过向下钻取过滤器来调查端点和接收的请求。

屏幕截图@H_419_73@

指示板视图显示摘要。

你可以创建过滤器来调查某些类型的请求。 [ alt text](/resources/filtering_all_screen。pngraw=true"按端点筛选")?

你可以看到请求的所有细节。

快速启动@H_419_73@

通过例子可以很容易理解烧瓶的轮廓。 让我们来。

按pip安装烧瓶探查器。

pip install flask_profiler

在创建 Flask 应用程序时编辑你的代码。

# your app.py@H_502_116@from flask @H_502_116@import Flask@H_502_116@import flask_profiler app @H_502_116@= Flask(__name__) app.config["DEBUG"] @H_502_116@=True# You need to declare necessary configuration to initialize# flask-profiler as follows:app.config["flask_profiler"] @H_502_116@= { "enabled": app.config["DEBUG"], "storage": { "engine": "sqlite" }, "basicAuth":{ "enabled": True, "username": "admin", "password": "admin" }, "ignore": [ "^/static/.*" ] }@app.route(/product/<ID>, methods@H_502_116@=[GET])@H_502_116@defgetProduct(ID): @H_502_116@return"product ID is "@H_502_116@+str(ID)@app.route(/product/<ID>, methods@H_502_116@=[
总结

以上是内存溢出为你收集整理的flask-profiler, 监视端点调用并尝试进行某些分析的Flask 事件探查器全部内容,希望文章能够帮你解决flask-profiler, 监视端点调用并尝试进行某些分析的Flask 事件探查器所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1195407.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存