parent
5bd0fe0300
commit
34d0ee5954
|
@ -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"],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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__":
|
||||
|
|
Loading…
Reference in New Issue