entity framework - How to make Appstats show both small and read operations? -
i'm profiling application locally (using dev server) more information how gae works. tests comparing common full entity query , projection query. in tests both queries same query, projection specified 2 properties. test kind has 100 properties, same value each entity, total of 10 entities. image datastore viewer , appstats generated data shown bellow. in appstats image, request 4 memcache flush, request 3 test database creation (it created, no costs here), request 2 full entity query , request 1 projection query.
i'm surprised both queries resulted in same amount of reads. guess small , read operations , being reported same appstats. if case, want separate them in reports. that's queries related functions:
// full entity query public returncodes doquery() { datastoreservice datastore = datastoreservicefactory.getdatastoreservice(); for(int = 0; < numiters; ++i) { filter filter = new filterpredicate(dbcreation.property_name_prefix + i, filteroperator.not_equal, i); query query = new query(dbcreation.entity_name).setfilter(filter); preparedquery prepquery = datastore.prepare(query); iterable<entity> results = prepquery.asiterable(); for(entity result : results) { log.info(result.tostring()); } } return returncodes.success; } // projection query public returncodes doquery() { datastoreservice datastore = datastoreservicefactory.getdatastoreservice(); for(int = 0; < numiters; ++i) { string projectionpropname = dbcreation.property_name_prefix + i; filter filter = new filterpredicate(dbcreation.property_name_prefix + i, filteroperator.not_equal, i); query query = new query(dbcreation.entity_name).setfilter(filter); query.addprojection(new propertyprojection(dbcreation.property_name_prefix + 0, integer.class)); query.addprojection(new propertyprojection(dbcreation.property_name_prefix + 1, integer.class)); preparedquery prepquery = datastore.prepare(query); iterable<entity> results = prepquery.asiterable(); for(entity result : results) { log.info(result.tostring()); } } return returncodes.success; }
any ideas?
edit: better overview of problem have created test, same query uses keys query instead. case, appstats correctly showing datastore_small operations in report. i'm still pretty confused behavior of projection query should reporting datastore_small operations. please help!
[i wrote go port of appstats, based on experience , recollection.]
my guess bug in appstats, relatively unmaintained program. projection queries new, appstats may not aware of them, , treats them normal read queries.
for background, calculating costs difficult. write ops, cost returned results, must be, since app has no way of knowing changed (which write costs happen). reads , small ops, however, there formula calculate cost. each appstats implementation (python, java, go) must implement calculation, including reflection or whatever needed on request object determine what's going on. apis doing not entirely obvious, , there's lots of little things, it's easy wrong, , annoying right.
Comments
Post a Comment