我正在阅读 Google App Engine 组的许多用户(Fig1、Fig2、Fig3),他们无法弄清楚在其计费报告中读取的大量 Datastore 来自何处。
您可能知道,Datastore 读取的上限为 50K 操作/天,高于您必须支付的预算。
50K 操作听起来像是很多资源,但不幸的是,似乎每个操作(Query、Entity fetch、Count..)都隐藏了几个 Datastore 读取。
是否可以通过 API 或其他方法知道有多少 Datastore 读取隐藏在 common调用 RPC.get
后面?RPC.runquery
在这种情况下, Appstats似乎没用,因为它只提供 RPC 详细信息,而不是隐藏的读取成本。
有一个像这样的简单模型:
class Example(db.Model):
foo = db.StringProperty()
bars= db.ListProperty(str)
和数据存储区中的1000 个实体,我对这些操作的成本感兴趣:
items_count = Example.all(keys_only = True).filter('bars=','spam').count()
items_count = Example.all().count(10000)
items = Example.all().fetch(10000)
items = Example.all().filter('bars=','spam').filter('bars=','fu').fetch(10000)
items = Example.all().fetch(10000, offset=500)
items = Example.all().filter('foo>=', filtr).filter('foo<', filtr+ u'\ufffd')