CC-4661: Listener Statistics

-add mount point names
This commit is contained in:
Martin Konecny 2012-11-02 18:04:32 -04:00
parent 5bd0fe0300
commit 34d0ee5954
2 changed files with 7 additions and 5 deletions

View File

@ -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"],
)
);
}

View File

@ -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__":