profiler.py 689 B

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