Edit your wsgi.py file to wrap your application
object as shown in the attached example.
Then go to /__guppy__
to see memory usage profiling.
This is very basic and probably needs to be refined.
# TODO 1.5 Does shutdown belong on Order? | |
@defer_to_detail | |
def shutdown(self, reason, comment, by_user): | |
log.debug('Shutdown order (%s) for reason: %s' % (self, reason)) | |
if reason == self.Status.RETURN: | |
# we're going to ignore deactivated and promo cards, and shutdown as long | |
# as the primary cards are pristine | |
deactivated_statuses = [gift_card.Certificate.Status.RETURN, | |
gift_card.Certificate.Status.DELETED, gift_card.Certificate.Status.FRAUD] |
# example of: | |
# non-trivial comments | |
# object linking using reStructured text class syntax | |
# self-documenting methods | |
@defer_to_detail | |
def shutdown(self, reason, comment, by_user): | |
""" Shuts down the entire order. After a successful shutdown, the | |
shutdown reason, additional free form comments and the user are | |
annotated onto the order. |
We're sorry... | |
This IP is only allowed to access our API. | |
To protect our users, we can't process requests from this IP address. | |
If you believe you have reached this page in error, contact us. |
#!/usr/bin/env python | |
from wsgi import * | |
from django.contrib.auth.models import User | |
from pymongo.errors import AutoReconnect, ConfigurationError | |
import time | |
deadline = time.time() + 600 | |
while time.time() < deadline: | |
try: | |
User.objects.count() | |
print 'Successfully connected to database.' |
Edit your wsgi.py file to wrap your application
object as shown in the attached example.
Then go to /__guppy__
to see memory usage profiling.
This is very basic and probably needs to be refined.
### Keybase proof | |
I hereby claim: | |
* I am johncosta on github. | |
* I am johncosta (https://keybase.io/johncosta) on keybase. | |
* I have a public key whose fingerprint is 9601 0D43 439B 11F6 6ECA FCB1 837A 319D F332 E5DA | |
To claim this, I am signing this object: |
FROM scratch | |
ADD https://github.com/johncosta/small-file/blob/master/small_file/ / | |
CMD ["sh"] |