flask-profiler, 监视端点调用并尝试进行某些分析的Flask 事件探
发布时间:2020-12-20 12:47:30 所属栏目:Python 来源:网络整理
导读:源代码名称: 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 ht
flask-profiler源代码下载
?
烧瓶分析器
版本:1.6 它给出了这些问题的答案:
简而言之,如果你对端点正在做什么和接收的请求进行了了解,请尝试打瓶探查器。 通过使用烧瓶分析器接口,你可以监视所有端点的性能,并通过向下钻取过滤器来调查端点和接收的请求。 屏幕截图指示板视图显示摘要。 你可以创建过滤器来调查某些类型的请求。 [ alt text](/resources/filtering_all_screen。pngraw=true"按端点筛选")? 你可以看到请求的所有细节。 快速启动通过例子可以很容易理解烧瓶的轮廓。 让我们来。 按pip安装烧瓶探查器。 pip install flask_profiler
在创建 Flask 应用程序时编辑你的代码。 # your app.pyfrom flask import Flaskimport flask_profiler app = Flask(__name__) app.config["DEBUG"] =True# You need to declare necessary configuration to initialize# flask-profiler as follows:app.config["flask_profiler"] = { "enabled": app.config["DEBUG"], "storage": { "engine": "sqlite" }, "basicAuth":{ "enabled": True, "username": "admin", "password": "admin" }, "ignore": [ "^/static/.*" ] }@app.route(‘/product/<id>‘, methods=[‘GET‘])defgetProduct(id): return"product id is "+str(id)@app.route(‘/product/<id>‘, methods=[ |