Last active
December 17, 2015 23:29
-
-
Save teisman/5689497 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MongoEngine's useful tool called query_counter | |
from mongoengine.context_managers import query_counter | |
# Initialize counter | |
c = query_counter() | |
with c: | |
# make MongoDB calls via MongoEngine API | |
# e.g. User.objects.all() | |
pass | |
# Print the number of MongoDB queries that were made in the above statements | |
print c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment