开发者

app engine datastore stats on development server

开发者 https://www.devze.com 2023-01-27 00:21 出处:网络
I\'m trying to get a list of entity types that have been persisted as documented, but the queries do not return any results on the development server.

I'm trying to get a list of entity types that have been persisted as documented, but the queries do not return any results on the development server.

DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
PreparedQuery kindStats = datastore.prepare(new Query("__Stat_Kind__"));

for (Entity kindStat : kindStats.asList(withDefaults())) {
  String kind_name = (String) kindStat.getProperty("kind_name");
}

Nor does this work on the development server:

DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity globalStat = datastore.prepare(new Query("__Stat_Total__")).asSingleEntity开发者_开发百科();
Long totalBytes = (Long) globalStat.getProperty("bytes");
Long totalEntities = (Long) globalStat.getProperty("count");

Is there another way to do this, or is it not supposed to be possible?


I'm sorry I can't find the documentation to support this belief, but I believe that:

  • stats don't work on the development server right now
  • Google is planning on making them work before too long


This url below can help you:

PreparedQuery.countEntities() clarifications

0

精彩评论

暂无评论...
验证码 换一张
取 消