google.appengine.ext.ndb.stats module

Summary

Models to be used when accessing app specific datastore usage statistics.

These entities cannot be created by users, but are populated in the application’s datastore by offline processes run by the Google App Engine team.

Contents

class google.appengine.ext.ndb.stats.BaseKindStatistic(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseStatistic

Base Statistic Model class for stats associated with kinds.

kind_name

the name of the kind associated with the statistic instance.

entity_bytes

the number of bytes taken up to store the statistic in Cloud Datastore minus the cost of storing indices.

STORED_KIND_NAME = '__BaseKindStatistic__'
entity_bytes

A Property whose value is a Python int or long (or bool).

kind_name

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.BaseStatistic(*args, **kwds)source

Bases: google.appengine.ext.ndb.model.Model

Base Statistic Model class.

bytes

the total number of bytes taken up in Cloud Datastore for the statistic instance.

count

attribute is the total number of occurrences of the statistic in Cloud Datastore.

timestamp

the time the statistic instance was written to Cloud Datastore.

STORED_KIND_NAME = '__BaseStatistic__'
bytes

A Property whose value is a Python int or long (or bool).

count

A Property whose value is a Python int or long (or bool).

timestamp

A Property whose value is a datetime object.

Note: Unlike Django, auto_now_add can be overridden by setting the value before writing the entity. And unlike classic db, auto_now does not supply a default value. Also unlike classic db, when the entity is written, the property values are updated to match what was written. Finally, beware that this also updates the value in the in-process cache, and that auto_now_add may interact weirdly with transaction retries (a retry of a property with auto_now_add set will reuse the value that was set on the first try).

class google.appengine.ext.ndb.stats.GlobalStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseStatistic

An aggregate of all entities across the entire application.

This statistic only has a single instance in Cloud Datastore that contains the total number of entities stored and the total number of bytes they take up.

entity_bytes

the number of bytes taken up to store the statistic in Cloud Datastore minus the cost of storing indices.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

composite_index_bytes

the number of bytes taken up to store composite index entries

composite_index_count

the number of composite index entries.

STORED_KIND_NAME = '__Stat_Total__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

composite_index_bytes

A Property whose value is a Python int or long (or bool).

composite_index_count

A Property whose value is a Python int or long (or bool).

entity_bytes

A Property whose value is a Python int or long (or bool).

class google.appengine.ext.ndb.stats.KindCompositeIndexStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseStatistic

Statistic on (kind, composite_index_id) tuples in Cloud Datastore.

There is an instance of the KindCompositeIndexStat for every unique (kind, composite_index_id) tuple in the application’s datastore indexes.

index_id

the id of the composite index associated with the statistic instance.

kind_name

the name of the kind associated with the statistic instance.

STORED_KIND_NAME = '__Stat_Kind_CompositeIndex__'
index_id

A Property whose value is a Python int or long (or bool).

kind_name

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.KindNonRootEntityStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

Statistics of the number of non root entities in Cloud Datastore by Kind.

There is an instance of the KindNonRootEntityStat for every Kind that is in the application’s datastore that is a not a root entity. This stat contains statistics regarding thse non root entity instances.

STORED_KIND_NAME = '__Stat_Kind_NotRootEntity__'
class google.appengine.ext.ndb.stats.KindPropertyNamePropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

Statistic on (kind, property_name, property_type) tuples in Cloud Datastore.

There is an instance of the KindPropertyNamePropertyTypeStat for every (kind, property_name, property_type) tuple in the application’s datastore.

property_type

the property type associated with the statistic instance.

property_name

the name of the property associated with the statistic instance.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

STORED_KIND_NAME = '__Stat_PropertyType_PropertyName_Kind__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

property_name

An indexed Property whose value is a text string of limited length.

property_type

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.KindPropertyNameStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

Statistics on (kind, property_name) tuples in the app’s datastore.

There is an instance of the KindPropertyNameStat for every (kind, property_name) tuple in the application’s datastore.

property_name

the name of the property associated with the statistic instance.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

STORED_KIND_NAME = '__Stat_PropertyName_Kind__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

property_name

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.KindPropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

Statistics on (kind, property_type) tuples in the app’s datastore.

There is an instance of the KindPropertyTypeStat for every (kind, property_type) tuple in the application’s datastore.

property_type

the property type associated with the statistic instance.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

STORED_KIND_NAME = '__Stat_PropertyType_Kind__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

property_type

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.KindRootEntityStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

Statistics of the number of root entities in Cloud Datastore by Kind.

There is an instance of the KindRootEntityState for every Kind that is in the application’s datastore and has an instance that is a root entity. This stat contains statistics regarding these root entity instances.

STORED_KIND_NAME = '__Stat_Kind_IsRootEntity__'
class google.appengine.ext.ndb.stats.KindStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseKindStatistic

An aggregate of all entities at the granularity of their Kind.

There is an instance of the KindStat for every Kind that is in the application’s datastore. This stat contains per-Kind statistics.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

composite_index_bytes

the number of bytes taken up to store composite index entries

composite_index_count

the number of composite index entries.

STORED_KIND_NAME = '__Stat_Kind__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

composite_index_bytes

A Property whose value is a Python int or long (or bool).

composite_index_count

A Property whose value is a Python int or long (or bool).

class google.appengine.ext.ndb.stats.NamespaceGlobalStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.GlobalStat

GlobalStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_Total__'
class google.appengine.ext.ndb.stats.NamespaceKindCompositeIndexStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindCompositeIndexStat

KindCompositeIndexStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_Kind_CompositeIndex__'
class google.appengine.ext.ndb.stats.NamespaceKindNonRootEntityStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindNonRootEntityStat

KindNonRootEntityStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_Kind_NotRootEntity__'
class google.appengine.ext.ndb.stats.NamespaceKindPropertyNamePropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindPropertyNamePropertyTypeStat

KindPropertyNamePropertyTypeStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_PropertyType_PropertyName_Kind__'
class google.appengine.ext.ndb.stats.NamespaceKindPropertyNameStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindPropertyNameStat

KindPropertyNameStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_PropertyName_Kind__'
class google.appengine.ext.ndb.stats.NamespaceKindPropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindPropertyTypeStat

KindPropertyTypeStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_PropertyType_Kind__'
class google.appengine.ext.ndb.stats.NamespaceKindRootEntityStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindRootEntityStat

KindRootEntityStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_Kind_IsRootEntity__'
class google.appengine.ext.ndb.stats.NamespaceKindStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.KindStat

KindStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_Kind__'
class google.appengine.ext.ndb.stats.NamespacePropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.PropertyTypeStat

PropertyTypeStat equivalent for a specific namespace.

These may be found in each specific namespace and represent stats for that particular namespace.

STORED_KIND_NAME = '__Stat_Ns_PropertyType__'
class google.appengine.ext.ndb.stats.NamespaceStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseStatistic

An aggregate of all entities across an entire namespace.

This statistic has one instance per namespace. The key_name is the represented namespace. NamespaceStat entities will only be found in the namespace “” (empty string). It contains the total number of entities stored and the total number of bytes they take up.

subject_namespace

the namespace associated with the statistic instance.

entity_bytes

the number of bytes taken up to store the statistic in Cloud Datastore minus the cost of storing indices.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

composite_index_bytes

the number of bytes taken up to store composite index entries

composite_index_count

the number of composite index entries.

STORED_KIND_NAME = '__Stat_Namespace__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

composite_index_bytes

A Property whose value is a Python int or long (or bool).

composite_index_count

A Property whose value is a Python int or long (or bool).

entity_bytes

A Property whose value is a Python int or long (or bool).

subject_namespace

An indexed Property whose value is a text string of limited length.

class google.appengine.ext.ndb.stats.PropertyTypeStat(*args, **kwds)source

Bases: google.appengine.ext.ndb.stats.BaseStatistic

An aggregate of all properties across the entire application by type.

There is an instance of the PropertyTypeStat for every property type (google.appengine.api.datastore_types._PROPERTY_TYPES) in use by the application in its datastore.

property_type

the property type associated with the statistic instance.

entity_bytes

the number of bytes taken up to store the statistic in Cloud Datastore minus the cost of storing indices.

builtin_index_bytes

the number of bytes taken up to store builtin-in index entries

builtin_index_count

the number of built-in index entries.

STORED_KIND_NAME = '__Stat_PropertyType__'
builtin_index_bytes

A Property whose value is a Python int or long (or bool).

builtin_index_count

A Property whose value is a Python int or long (or bool).

entity_bytes

A Property whose value is a Python int or long (or bool).

property_type

An indexed Property whose value is a text string of limited length.