How do I calculate the size of an entity stored in Google App Engine? -


Is there an easy way to calculate the size of the entity stored in app engine? I would like to know how to kill the upper limit of 1 MB on the unit size is a special unit

app engine Stores each unit as one. You can use the db.model_to_protobuf () function to manually convert your unit into a proto, and then set the standard len () to set its size in bytes. / Code> method. / P>

Example Usage:

  to google.appengine.ext import db sz_in_bytes = len (db.model_to_protobuf (some_entity). Encode ())  

Updates for NDB

In the comments given below, kiketo indicates that a different approach is needed for the ndb organizations (thanks kekato!): < / P>

  lane (some_entity._to_pb (). Encode ())  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -