Nirav Patel
Nirav Patel

Reputation: 1327

GAE Cloud Datastore: Get most frequently written models

I am trying to get the list of models in decreasing order of most frequently written models. This is what I have tried so far.This client query set gives the details of models and their attributes/properties, with these model related details : Entity count, Built-in index count, Built-in index size, Data size, Composite index size, Composite index count, Total Size. But there is no detail about write frequencies and/or any analytics about database put() or save() operations.

from google.cloud import datastore
import math

def run_quickstart():
    # [START datastore_quickstart]
    # Imports the Google Cloud client library

    client = datastore.Client()
    query = client.query(kind='__Stat_Kind__')
    detail_list = []
    items = list(query.fetch())
    for results in items:
        results = results.viewitems()
        detail_list.append(results)

    print detail_list

if __name__ == '__main__':
    run_quickstart()

Does GAE Cloud Datastore provide any such information of database write frequencies? My main objective is to get most busy model/ database table with most writes.

Upvotes: 3

Views: 92

Answers (1)

minou
minou

Reputation: 16563

No, GAE does not record write frequency of entities. It is easy enough to implement yourself by adding a property to record the number of times an entity has been put and increment it on each write.

Upvotes: 4

Related Questions