google.appengine.ext.appstats.loader module

Summary

Loading appstats data from and to various sources like file, memcache etc.

The file currently has modules to read data from memcache, to write appstats data to a file in pickled format, and to read records from a file after unpickling. The script is envisioned to be extensible in the future to allow reading/writing to/from datastore, storing data in alternate file formats such as SQLLite etc.

Contents

google.appengine.ext.appstats.loader.FromMemcache(filter_timestamp=0, java_application=False)source

Reads appstats data from memcache.

Get all appstats full records from memcache which correspond to requests with a greater timestamp than filter_timestamp

Parameters
  • filter_timestamp -- only retrieve records with timestamp (in milliseconds) higher than this value. If 0, all records are retrieved.

  • java_application -- Boolean. If true, this function is being called by the download_appstats tool for a Java application.

Returns

List of RequestStatProto protobufs.

google.appengine.ext.appstats.loader.PickleToFile(records, outfile)source

Writes appstats data to file.

Parameters
  • records -- list of RequestStatProto protobufs

  • outfile -- file object to write appstats data to

Returns

None.

File format is a pickled list of protobufs encoded as binary strings.

google.appengine.ext.appstats.loader.UnpickleFromFile(datafile)source

Reads appstats data from file.

Parameters

datafile -- file object to read appstats data from. File format is a pickled list of protobufs encoded as binary strings.

Returns

List of RequestStatProto protobufs.

Send feedback about...

App Engine standard environment for Python