Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime