if __name__ == '__main__': from app.web import run run()
#!/usr/bin/python # -*- coding: utf-8 -*- from app import web from app.monitor.Monitor import Monitor import threading, time from app.util import ConfUtil from app.util.LogUtil import log def run(): monitor = Monitor() while True: try: monitor.check() except Exception, e: log.error(e) time.sleep(ConfUtil.getCycle()) if __name__ == '__main__': thread = threading.Thread(target = run, name = 'monitor') thread.start() log.info('Starting...') web.run(host='0.0.0.0', port=5000)
#!/usr/bin/python # -*- coding: utf-8 -*- from app import web from app.monitor.Monitor import Monitor import threading, time from app.util import ConfUtil from app.util.LogUtil import log def run(): monitor = Monitor() while True: try: monitor.check() except Exception, e: log.error(e) time.sleep(ConfUtil.getCycle()) if __name__ == '__main__': thread = threading.Thread(target=run, name='monitor') thread.start() log.info('Starting...') web.run(host='0.0.0.0', port=5000)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ profile ~~~~~~~ Implements the profile performance for cobra :author: Feei <wufeifei#wufeifei.com> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2016 Feei. All rights reserved """ from werkzeug.contrib.profiler import ProfilerMiddleware from app import web __author__ = "lightless" __email__ = "*****@*****.**" web.config['PROFILE'] = True web.wsgi_app = ProfilerMiddleware(web.wsgi_app, restrictions=[30]) web.run(debug=True)
#!/usr/bin/env python # # Copyright 2016 Feei. All Rights Reserved # # Author: Feei <*****@*****.**> # Homepage: https://github.com/wufeifei/cobra # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # See the file 'doc/COPYING' for copying permission # from werkzeug.contrib.profiler import ProfilerMiddleware from app import web __author__ = "lightless" __email__ = "*****@*****.**" web.config['PROFILE'] = True web.wsgi_app = ProfilerMiddleware(web.wsgi_app, restrictions=[30]) web.run(debug=True)