Book Image

Mastering Google App Engine

Book Image

Mastering Google App Engine

Overview of this book

Table of Contents (18 chapters)
Mastering Google App Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

AppStats


It is important to know how your application is performing. A Google App Engine application mainly calls various API methods that result in RPC calls, which effectively are network calls. If you have data of what kind of calls are being made, where and what calls are the most time-consuming, you can optimize, tweak, or structure your code in accordance to make optimal use of resources.

That's exactly where the RPC profiling comes in, which is also known as AppStats. To enable it, there are two steps to it:

  • Enabling the recording of events

  • Enabling the user interface to browse it

To enable it, you have to add a WSGI middleware to your application that will record various statistics. In case of webapp2, that's simple. You can simply do it like this at the location where you have an application object in main.py file (or wherever it is):

# After all the handlers defined above:
application = webapp2.WSGIApplication([
    ('/', MainPage),
], debug=True)
from google.appengine.ext.appstats...