From 993318b503e8830db687d4ec4cfb87edb0541405 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Mon, 7 Jan 2019 01:31:30 -0800 Subject: [PATCH] Add stacksampler to all services --- backfiller/backfiller/main.py | 1 + downloader/downloader/main.py | 1 + restreamer/restreamer/main.py | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index 2b2288f..231b29d 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -247,6 +247,7 @@ def main(base_dir='.', stream='', variants='', fill_wait=5, full_fill_wait=180, nodes = nodes.split(',') if nodes else [] common.PromLogCountsHandler.install() + common.install_stacksampler() prom.start_http_server(metrics_port) if backdoor_port: diff --git a/downloader/downloader/main.py b/downloader/downloader/main.py index 3189fcb..01350c5 100644 --- a/downloader/downloader/main.py +++ b/downloader/downloader/main.py @@ -527,6 +527,7 @@ def main(channel, base_dir=".", qualities="source", metrics_port=8001, backdoor_ manager = StreamsManager(channel, base_dir, qualities) gevent.signal(signal.SIGTERM, manager.stop) # shut down on sigterm common.PromLogCountsHandler.install() + common.install_stacksampler() prom.start_http_server(metrics_port) if backdoor_port: gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() diff --git a/restreamer/restreamer/main.py b/restreamer/restreamer/main.py index 1b80816..18b70c3 100644 --- a/restreamer/restreamer/main.py +++ b/restreamer/restreamer/main.py @@ -17,7 +17,7 @@ from flask import Flask, url_for, request, abort, Response from gevent import subprocess from gevent.pywsgi import WSGIServer -from common import get_best_segments, PromLogCountsHandler +from common import get_best_segments, PromLogCountsHandler, install_stacksampler import generate_hls from stats import stats, after_request @@ -421,6 +421,7 @@ def main(host='0.0.0.0', port=8000, base_dir='.', backdoor_port=0): gevent.signal(signal.SIGTERM, stop) PromLogCountsHandler.install() + install_stacksampler() if backdoor_port: gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start()