def enable_appstats(app):
  try:
    from google.appengine.ext.appstats.recording import appstats_wsgi_middleware
    app.app = appstats_wsgi_middleware(app.app)
  except Exception, e:
    logging.error(
      'Failed to initialize AppStats. Exception encountered: "' + str(e) + '".')
  return app
Utility function that enables appstats middleware.
dataset/ETHPy150Open gregorynicholas/flask-gae_runtools/gae_runtools.py/enable_appstats