为Google Cloud端点设置指标 [英] Setting up metrics for Google Cloud endpoints
本文介绍了为Google Cloud端点设置指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在生产服务器上设置Google Cloud端点。什么是配置请求的好方法? Appstats 仅支持WSGI请求。
预先感谢。
解决方案
我实际上可以解决这个问题。挖掘端点,我可以看到它实际上是一个WSGI服务器。并且使用Appstats进行测试并且完美地工作,它需要被添加到文档中。
在appengine_config.py中,我这样做了:
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats导入记录
app = recording.appstats_wsgi_middleware(app)
返回应用程序
webapp_add_wsgi_middleware(api_app)
这也适用于产品。
I want to set up Google Cloud endpoints on a production server. What would be a good way to profile requests? Appstats support only WSGI requests.
Thanks in advance.
解决方案
I could actually solve this. Digging into endpoints, I could see that it is actually a WSGI server. And tested it with Appstats and works perfectly, it needs to be added to documentation.
In appengine_config.py, I did this:
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
webapp_add_wsgi_middleware(api_app)
This works well on production too.
这篇关于为Google Cloud端点设置指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文