I need to get Google Datastore usage statistics - storage usage, and record count for my application.
我需要获取Google Datastore使用情况统计信息 - 存储空间使用情况以及应用程序的记录数。
At the moment I only can count fetch all items and count them. But I have no idea how I can get storage amount used.
目前我只能计算获取所有项目并计算它们。但我不知道如何使用存储量。
Is there any reports API I can use? (Like Google Apps report api)
我可以使用任何报告API吗? (与Google Apps报告API一样)
PS. I use gcloud-python library to access Datastore.
PS。我使用gcloud-python库来访问数据存储区。
Edited:
Thank you Andrei - Angels Like Reb
谢谢Andrei - Angels Like Reb
That's how I did it:
这就是我做到的方式:
from gcloud import datastore
stat = list(datastore.Query('__Stat_Total__').fetch())[0]
print "bytes", stat['bytes']
print "count", stat['count']
1 个解决方案
#1
You can use statistics queries.
您可以使用统计信息查询。