Appstats are only working for one WSGIApplication

大城市里の小女人 提交于 2019-12-19 04:50:44

问题


I've split handlers between 2 python files (main.py and main_cms.py). app.yaml defines the URLs that each python file will handle.

When I look at the Appstats, only the handlers from one of the 2 python files are profiled (the ones from main.py). The 'magic' of webapp_add_wsgi_middleware(app) always used to work just fine, until the split. How can I make Appstats recording apply to all handlers?

appengine_config.py:

def webapp_add_wsgi_middleware(app):     
    from google.appengine.ext.appstats import recording
    app = recording.appstats_wsgi_middleware(app)
    return app

app.yaml:

builtins:
- appstats: on

...

- url: /services/.*
  script: main.application

- url: /cms.*
  script: main_cms.application

main.py and main_cms.py:

application = webapp2.WSGIApplication(url_mapping, config=config)

Running python2.7 / GAE 1.6.3, the dev_appserver.py shows Appstats correct for all handlers. The described problem is only seen in production.

来源:https://stackoverflow.com/questions/9738518/appstats-are-only-working-for-one-wsgiapplication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!