![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | Reset |
def | IsCached |
def | Insert |
Public Attributes | |
hascontents | |
filename | |
mtime | |
recordlist | |
Cache appstats records for better tool performance. Loading full Appstats records from file is time consuming mainly because of the overheads in converting binary protobuf strings to python protobuf objects. Caching the records can help ensure this is done only the first time the main page is loaded, and the overheads are avoided as the user navigates the tool. Note that caching is intended for the offline analysis case (e.g. analyzing locally downloaded files). In online production, local caches might not be effective as requests go to multiple app servers. Also, there might be issues around memcache getting updated periodically. Note that we store the file name and the time the file has been last modified to identify if the cache is still valid.
def google.appengine.ext.analytics.main.Cache.__init__ | ( | self | ) |
Constructor.
def google.appengine.ext.analytics.main.Cache.Insert | ( | self, | |
source, | |||
mtime, | |||
recordlist | |||
) |
Insert records in cache. Args: source: name of file whose data is being cached. mtime: last modification time of file being cached. recordlist: list of StatsProto instances retrieved from file in reverse chronological order (i.e. most recent first).
def google.appengine.ext.analytics.main.Cache.IsCached | ( | self, | |
source, | |||
mtime | |||
) |
Check whether data from a file is cached. Args: source: name of file being read mtime: last modification time of file being read Returns: A boolean: true if cached, false otherwise.
def google.appengine.ext.analytics.main.Cache.Reset | ( | self | ) |
Reset and delete cache contents.