예제 #1
0
def main():
    try:
        config.parse_args()
        log.setup('muranoapi')
        request_statistics.init_stats()

        launcher = service.ServiceLauncher()

        app = config.load_paste_app('muranoapi')
        port, host = (config.CONF.bind_port, config.CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError, e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
예제 #2
0
 def __init__(self):
     super(StatsCollectingService, self).__init__()
     request_statistics.init_stats()
     self._hostname = socket.gethostname()
     self._stats_db = db_stats.Statistics()
     self._prev_time = time.time()