I had used Appstats to record my ndb usage in my GAE project, and it worked very well. My Appstats setup was following this doc.
Recently, I move some ndb code to be executed on background thread, but those ndb calls don't show on Appstats console UI any more.
I have tried Appstats in both the dev and prod, they don't record ndb RPCs made in background thread.
To make the question clear, I means: Appstats works for:
class MyHandler(webapp2.RequestHandler):
def put(self):
...
do_a_lot_of_ndb_work()
...
but Appstats doesn't work for:
class MyHandler(webapp2.RequestHandler):
def put(self):
...
background_thread.start_new_background_thread(do_a_lot_of_ndb_work, [])
...
Can I change some parameters in appengine_config.py or do something to make Appstats works for both?
Update: The above code snippets are running in backend (basic_scaling, max_instances=1), and the thread usage is referenced from https://developers.google.com/appengine/docs/python/modules/#Python_Background_threads