From 34d0ee5954cded222beeb1412452cf2ee092c0a0 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 2 Nov 2012 18:04:32 -0400 Subject: [PATCH] CC-4661: Listener Statistics -add mount point names --- airtime_mvc/application/models/ListenerStat.php | 8 +++++--- python_apps/pypo/listenerstat.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/ListenerStat.php b/airtime_mvc/application/models/ListenerStat.php index 9ba8b0f8b..15254a96b 100644 --- a/airtime_mvc/application/models/ListenerStat.php +++ b/airtime_mvc/application/models/ListenerStat.php @@ -22,15 +22,17 @@ SQL; $timestamp_sql = "INSERT INTO cc_timestamp (timestamp) VALUES (:ts::TIMESTAMP) RETURNING id;"; - $stats_sql = "INSERT INTO cc_listener_count (timestamp_id, listener_count) - VALUES (:timestamp_id, :listener_count)"; + $stats_sql = "INSERT INTO cc_listener_count (timestamp_id, listener_count, mount_name) + VALUES (:timestamp_id, :listener_count, :mount_name)"; foreach ($p_dataPoints as $dp) { $timestamp_id = Application_Common_Database::prepareAndExecute($timestamp_sql, array('ts'=> $dp['timestamp']), "column"); Application_Common_Database::prepareAndExecute($stats_sql, array('timestamp_id' => $timestamp_id, - 'listener_count' => $dp["num_listeners"]) + 'listener_count' => $dp["num_listeners"], + 'mount_name' => $dp["mount_name"], + ) ); } diff --git a/python_apps/pypo/listenerstat.py b/python_apps/pypo/listenerstat.py index 983d31f93..431f05e98 100644 --- a/python_apps/pypo/listenerstat.py +++ b/python_apps/pypo/listenerstat.py @@ -102,11 +102,11 @@ class ListenerStat(Thread): self.logger.debug(stats) self.push_stream_stats(stats) - time.sleep(120) except Exception, e: top = traceback.format_exc() self.logger.error('Exception: %s', top) - time.sleep(120) + + time.sleep(120) if __name__ == "__main__":