From jpeg at videolan.org Fri Nov 20 20:18:04 2009 From: jpeg at videolan.org (=?UTF-8?q?Jean-Philippe=20Andr=C3=A9?=) Date: Fri, 20 Nov 2009 20:18:04 +0100 Subject: [vlma-devel] [PATCH] Configuration: remove " from the command line Message-ID: <1258744684-2202-1-git-send-email-jpeg@videolan.org> These are invalid in this scenario as vlc.py will split() the command line, thus the last argument was \"arg\" and not only arg as expected. --- vlma-watchdog/src/conf.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vlma-watchdog/src/conf.py b/vlma-watchdog/src/conf.py index 061a5f0..83cd773 100644 --- a/vlma-watchdog/src/conf.py +++ b/vlma-watchdog/src/conf.py @@ -13,7 +13,7 @@ def get_VLC_ARGS(version): return "-vvv --rtsp-host 0.0.0.0:5554 --intf telnet --telnet-port %d" %VLC_TELNET_PORT else: # VLC 0.9 and higher - return "-vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet --lua-config \"telnet={hosts={'*:%d'}}\"" %VLC_TELNET_PORT + return "-vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet --lua-config telnet={hosts={'*:%d'}}" %VLC_TELNET_PORT CPU_LOAD_THRESHOLD = 6.0 VLC_CPU_THRESHOLD = 80.0 -- 1.6.5.3 From git at videolan.org Fri Nov 20 23:17:31 2009 From: git at videolan.org (git version control) Date: Fri, 20 Nov 2009 23:17:31 +0100 (CET) Subject: [vlma-devel] =?utf-8?q?commit=3A_Configuration=3A_remove_=22_from?= =?utf-8?q?_the_command_line_=28_Jean-Philippe_Andr=C3=A9_=29?= Message-ID: <20091120221731.138AB5E71EE@skanda.videolan.org> vlma | branch: master | Jean-Philippe Andr? | Fri Nov 20 20:18:04 2009 +0100| [971e294e6d100f8faf382db76ad249a4b24a5a1e] | committer: Adrien Grand Configuration: remove " from the command line These are invalid in this scenario as vlc.py will split() the command line, thus the last argument was \"arg\" and not only arg as expected. Signed-off-by: Adrien Grand > http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=971e294e6d100f8faf382db76ad249a4b24a5a1e --- vlma-watchdog/src/conf.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vlma-watchdog/src/conf.py b/vlma-watchdog/src/conf.py index 061a5f0..83cd773 100644 --- a/vlma-watchdog/src/conf.py +++ b/vlma-watchdog/src/conf.py @@ -13,7 +13,7 @@ def get_VLC_ARGS(version): return "-vvv --rtsp-host 0.0.0.0:5554 --intf telnet --telnet-port %d" %VLC_TELNET_PORT else: # VLC 0.9 and higher - return "-vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet --lua-config \"telnet={hosts={'*:%d'}}\"" %VLC_TELNET_PORT + return "-vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet --lua-config telnet={hosts={'*:%d'}}" %VLC_TELNET_PORT CPU_LOAD_THRESHOLD = 6.0 VLC_CPU_THRESHOLD = 80.0 From jpountz at videolan.org Fri Nov 20 23:21:45 2009 From: jpountz at videolan.org (Adrien Grand) Date: Fri, 20 Nov 2009 23:21:45 +0100 Subject: [vlma-devel] [PATCH] Configuration: remove " from the command line In-Reply-To: <1258744684-2202-1-git-send-email-jpeg@videolan.org> References: <1258744684-2202-1-git-send-email-jpeg@videolan.org> Message-ID: <4B071679.9080200@videolan.org> Jean-Philippe Andr? a ?crit : > These are invalid in this scenario as vlc.py will split() the command line, > thus the last argument was \"arg\" and not only arg as expected. Applied, thanks for the patch. -- Adrien Grand From git at videolan.org Fri Nov 27 11:49:30 2009 From: git at videolan.org (git version control) Date: Fri, 27 Nov 2009 11:49:30 +0100 (CET) Subject: [vlma-devel] commit: Moving towards DVBlast integration. (Adrien Grand ) Message-ID: <20091127104930.2789161A12A@skanda.videolan.org> vlma | branch: master | Adrien Grand | Fri Nov 27 11:48:20 2009 +0100| [b3f0fdf11d9042b40aad379296c1505b60f46188] | committer: Adrien Grand Moving towards DVBlast integration. > http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=b3f0fdf11d9042b40aad379296c1505b60f46188 --- vlma-watchdog/src/conf.py | 30 +-- vlma-watchdog/src/constants.py | 30 +++ vlma-watchdog/src/serialization.py | 86 +++----- vlma-watchdog/src/streamer/.gitignore | 1 + vlma-watchdog/src/streamer/__init__.py | 4 + vlma-watchdog/src/streamer/api.py | 249 ++++++++++++++++++ vlma-watchdog/src/streamer/dvblast.py | 8 + vlma-watchdog/src/streamer/vlc.py | 37 +++ vlma-watchdog/src/utils.py | 106 ++++++++ vlma-watchdog/src/vlc.py | 433 -------------------------------- vlma-watchdog/src/watchdog.py | 35 +++ vlma-watchdog/src/web.py | 181 ++++++-------- 12 files changed, 584 insertions(+), 616 deletions(-) Diff: http://git.videolan.org/gitweb.cgi/vlma.git/?a=commitdiff;h=b3f0fdf11d9042b40aad379296c1505b60f46188 From git at videolan.org Fri Nov 27 12:10:15 2009 From: git at videolan.org (git version control) Date: Fri, 27 Nov 2009 12:10:15 +0100 (CET) Subject: [vlma-devel] commit: Expose system metrics. (Adrien Grand ) Message-ID: <20091127111015.9926261A1F5@skanda.videolan.org> vlma | branch: master | Adrien Grand | Fri Nov 27 12:09:33 2009 +0100| [2fbf5f1a819e30318edf237cb1ca365ed9e020aa] | committer: Adrien Grand Expose system metrics. > http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=2fbf5f1a819e30318edf237cb1ca365ed9e020aa --- vlma-watchdog/src/serialization.py | 7 +++++++ vlma-watchdog/src/utils.py | 16 ++++++++++++++++ vlma-watchdog/src/web.py | 17 +++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/vlma-watchdog/src/serialization.py b/vlma-watchdog/src/serialization.py index bf82299..2818efa 100644 --- a/vlma-watchdog/src/serialization.py +++ b/vlma-watchdog/src/serialization.py @@ -31,3 +31,10 @@ def streamer_logs_to_xml(logs, writer): writer.write("%s" %(log[0], log[1])) writer.write("") +def system_metrics_to_xml(metrics, writer): + writer.write("" %NS) + writer.write("%f" %metrics.cpu_load) + writer.write("%f" %metrics.traffic_in) + writer.write("%f" %metrics.traffic_out) + writer.write("") + diff --git a/vlma-watchdog/src/utils.py b/vlma-watchdog/src/utils.py index 95174bf..5f64cb9 100644 --- a/vlma-watchdog/src/utils.py +++ b/vlma-watchdog/src/utils.py @@ -83,6 +83,22 @@ def getTrafficOut(): return _getTrafficX(9) +class SystemMetrics: + + def __init__(self): + self.cpu_load = 0. + self.traffic_in = 0. + self.traffic_out = 0. + + +def get_system_metrics(): + metrics = SystemMetrics() + metrics.cpu_load = getCpuLoad() + metrics.traffic_in = getTrafficIn() + metrics.traffic_out = getTrafficOut() + return metrics + + def signalHandler(signum, frame): """Triggered when a signal is sent.""" logger.warn("Signal %i received", signum) diff --git a/vlma-watchdog/src/web.py b/vlma-watchdog/src/web.py index 7473f4d..fa9bf62 100644 --- a/vlma-watchdog/src/web.py +++ b/vlma-watchdog/src/web.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- -import conf, logging, threading, serialization, sys +import conf, logging, threading, serialization, sys, utils try: from twisted.web import server, resource, static from twisted.internet import reactor @@ -25,6 +25,8 @@ class Server(threading.Thread): root.putChild("", IndexResource(self.__streamers)) root.putChild("schema.xsd", static.File("schema.xsd", defaultType='text/xml')) system = resource.Resource() + root.putChild("system", system) + system.putChild("metric", SystemMetricsResource()) streamers = StreamersResource(self.__streamers) root.putChild("streamer", streamers) for streamer in self.__streamers: @@ -78,7 +80,8 @@ class IndexResource(AuthenticationRequiredResource): def __init__(self, streamers): AuthenticationRequiredResource.__init__(self) self.links = [ - ("/streamer", "Streamers") + ("/streamer", "Streamers"), + ("/system/metric", "System metrics") ] for streamer in streamers: self.links.append(("/streamer/%s" %streamer.id, "Streamer %s (%s)" %(streamer.id, streamer.type))) @@ -125,6 +128,7 @@ class StreamerMetricsResource(AuthenticationRequiredResource): prepare_xml_response(request) serialization.streamer_metrics_to_xml(self.streamer, request) + class StreamerLogsResource(AuthenticationRequiredResource): def __init__(self, streamer): @@ -136,3 +140,12 @@ class StreamerLogsResource(AuthenticationRequiredResource): serialization.streamer_logs_to_xml(self.streamer.logs, request) +class SystemMetricsResource(AuthenticationRequiredResource): + + def __init__(self): + AuthenticationRequiredResource.__init__(self) + + def render_GET_authenticated(self, request): + prepare_xml_response(request) + serialization.system_metrics_to_xml(utils.get_system_metrics(), request) +