profiler.py 691 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. import logging
  3. from logging.config import dictConfig
  4. from werkzeug.contrib.profiler import ProfilerMiddleware
  5. # Environment must be set before importing the app factory function.
  6. import lakesuperior.env_setup
  7. from lakesuperior.config_parser import config
  8. from lakesuperior.globals import AppGlobals
  9. from lakesuperior.env import env
  10. options = {
  11. 'restrictions': [30],
  12. #'profile_dir': '/tmp/lsup_profiling'
  13. }
  14. from lakesuperior.app import create_app
  15. if __name__ == '__main__':
  16. fcrepo = create_app(config['application'])
  17. fcrepo.wsgi_app = ProfilerMiddleware(fcrepo.wsgi_app, **options)
  18. fcrepo.config['PROFILE'] = True
  19. fcrepo.run(debug = True)