google.appengine.ext.appstats.ui module

Summary

Web-based User Interface for appstats.

This is a simple set of webapp-based request handlers that display the collected statistics and let you drill down on the information in various ways.

Template files are in the templates/ subdirectory. Static files are in the static/ subdirectory.

The templates are written to work with either Django 0.96 or Django 1.0, and most likely they also work with Django 1.1.

Contents

class google.appengine.ext.appstats.ui.AllStatsInfo(calls, cost, billed_ops)source

Bases: object

AllStats data.

class google.appengine.ext.appstats.ui.AuthCheckMiddleware(application)source

Bases: object

Middleware which conducts an auth check.

class google.appengine.ext.appstats.ui.DetailsHandlersource

Bases: google.appengine.ext.webapp._webapp25.RequestHandler

Request handler for the details page (/stats/details).

get()source
class google.appengine.ext.appstats.ui.FileHandlersource

Bases: google.appengine.ext.webapp._webapp25.RequestHandler

Request handler for displaying any text file in the system.

NOTE: This gives any admin of your app full access to your source code.

get()source
class google.appengine.ext.appstats.ui.PathStatsInfo(cost, billed_ops, num_requests, most_recent_requests)source

Bases: object

PathStats data.

class google.appengine.ext.appstats.ui.PivotInfo(name, calls, cost, billed_ops, cost_pct)source

Bases: object

Pivot data. The name attribute can be an rpc or a path.

classmethod from_list(values)source
to_list()source

Convert to a list with values in the locations expected by the ui.

class google.appengine.ext.appstats.ui.ShellHandlersource

Bases: google.appengine.ext.webapp._webapp25.RequestHandler

Request handler for interactive shell.

This is like /_ah/admin/interactive, but with Appstats output integrated.

GET displays a form; POST runs some code and displays its output + stats.

execute_script(script)source
get()source
post()source
class google.appengine.ext.appstats.ui.StaticHandlersource

Bases: google.appengine.ext.webapp._webapp25.RequestHandler

Request handler to serve static files.

Only files directory in the static subdirectory are rendered this way (no subdirectories).

get()source
class google.appengine.ext.appstats.ui.SummaryHandlersource

Bases: google.appengine.ext.webapp._webapp25.RequestHandler

Request handler for the main stats page (/stats/).

get()source
google.appengine.ext.appstats.ui.get_details_data(record, file_url=None)source

Calculate detailed appstats data for a single request.

Parameters
  • record – A RequestStatProto which contains detailed Appstats recording for an individual request.

  • file_url – Indicates the URL to be used to follow links to files in application source code. A default value of ‘None’ indicates that links to files in source code will not be shown.

Returns

A dictionary containing detailed appstats data for a single request.

google.appengine.ext.appstats.ui.main()source

Main program. Run the auth checking middleware wrapped WSGIApplication.

google.appengine.ext.appstats.ui.render(tmplname, data)source

Helper function to render a template.

google.appengine.ext.appstats.ui.render_record(response, record, file_url=None, extra_data=None)source

Render an appstats record in detail.

This is a minor refactoring of DetailsHandler to support an offline tool for analyzing Appstats data and to allow that tool to call the original Appstats detailed record visualization. Since the offline tool may read Appstats records from other sources (e.g., a downloaded file), we are moving the logic of DetailsHandler related to processing and visualizing individual Appstats records to this function. This function may now be called from outside this file.

Parameters
  • response – An instance of the webapp response class representing data to be sent in response to a web request.

  • record – A RequestStatProto which contains detailed Appstats recording for an individual request.

  • file_url – Indicates the URL to be used to follow links to files in application source code. A default value of ‘None’ indicates that links to files in source code will not be shown.

  • extra_data – Optional dict of additional parameters for template.