Exemple #1
0
def main():
    http_console_server.start(port=ARCHIVER_PORT)
    sys.stderr.write(">>> starting pipeline\n")
    try:
        run_pipeline()
    finally:
        http_console_server.stop()
    sys.stderr.write(">>> shutdown complete\n")
def main():
    http_console_server.start(port=ARCHIVER_PORT)
    sys.stderr.write(">>> starting pipeline\n")
    try:
        run_pipeline()
    finally:
        http_console_server.stop()
    sys.stderr.write(">>> shutdown complete\n")
Exemple #3
0
def main():
    http_console_server.start()

    hp = http_puller.HttpPuller(STREAM_HOST, STREAM_PORT, STREAM_PATH)

    hp_tee = message.MessageTee(hp, 2)
    hp_proxy, hp_fs = hp_tee.outputs

    proxy = http_proxy.HttpProxy(hp_proxy, STREAM_PROXY_HOST,
                                 STREAM_PROXY_PORT)
    fs = frame_splitter.FrameSplitter(hp_fs)

    fs_tee = message.MessageTee(fs, 2)
    fs_stats, fs_arch = fs_tee.outputs

    stats = statistics.Statistics(fs_stats)
    stats.export()

    # TODO(trow): Ultimately we'll put the archiver here.
    arch = logger.Logger(fs_arch)

    all_objects = (hp, hp_tee, proxy, fs, fs_tee, stats, arch)
    for obj in all_objects:
        obj.loop_in_thread()

    try:
        while True: time.sleep(1 << 20)  # 2^20 seconds = ~12 days
    except KeyboardInterrupt:
        pass

    sys.stderr.write(">>> stopping\n")
    hp.stop()
    for obj in all_objects:
        obj.wait()

    http_console_server.stop()
    sys.stderr.write(">>> shutdown complete\n")
Exemple #4
0
    def setUp(self):
        # Set a short timeout to speed up this test.
        http_console_server._HttpConsoleServer._TIMEOUT_S = 0.1

        # Start the server.
        http_console_server.start()