Exemple #1
0
def main():
	mysql_init()
	connect2gearman()
	connect2redis(host="127.0.0.1")
	RecvLog.recv_redis_log()
#	collect_log()
	pass
Exemple #2
0
def redis_logs2sqlList():
	mysql_init()
	myredis.connect2redis(host='127.0.0.1')
	while True:
		sql_str = myredis.redis_q.get('BiglogSqlList')
		sql_dic = json.loads(sql_str)
		sql = sql_dic['sql']
		args = sql_dic['args']
		biglog_mysql.mysql_instance.insert_many_log(sql,args)
Exemple #3
0
			data = myredis.redis_q.get('BiglogDict')
			log_info = json.loads(data)
#			print log_info
			biglog_rl.record_log_info(log_info)
		print "exit..."

	def _stop(self):
		global time_str 
		global time_unix
		self.thread_stop = True
#		print biglog_rl.log
		insert_log_time = {}
		insert_log_time['time_str'] = time_str
		insert_log_time['time_num'] = time_unix
		insert_log_time['UNIT'] = 'second'
		DisplayLogs.display_log_summary(biglog_rl.log,biglog_rl.log_key,insert_log_time)
		biglog_rl._clear()

if __name__ == '__main__':
	Watcher()
	connect2gearman()
	myredis.connect2redis(host='127.0.0.1')
	biglog_rl = RecordLogInfo()
	while True:
		time_str = time.strftime('%Y-%m-%d:%H:%M:%S',time.localtime(time.time()))
		time_unix = int(time.mktime(datetime.datetime.now().timetuple()))
		thread1 = BiglogTimer()
		thread1.start()
		time.sleep(10)
		thread1._stop()
Exemple #4
0
            biglog_rl.record_log_info(log_info)
        print "exit..."

    def _stop(self):
        global time_str
        global time_unix
        self.thread_stop = True
        #		print biglog_rl.log
        insert_log_time = {}
        insert_log_time['time_str'] = time_str
        insert_log_time['time_num'] = time_unix
        insert_log_time['UNIT'] = 'second'
        DisplayLogs.display_log_summary(biglog_rl.log, biglog_rl.log_key,
                                        insert_log_time)
        biglog_rl._clear()


if __name__ == '__main__':
    Watcher()
    connect2gearman()
    myredis.connect2redis(host='127.0.0.1')
    biglog_rl = RecordLogInfo()
    while True:
        time_str = time.strftime('%Y-%m-%d:%H:%M:%S',
                                 time.localtime(time.time()))
        time_unix = int(time.mktime(datetime.datetime.now().timetuple()))
        thread1 = BiglogTimer()
        thread1.start()
        time.sleep(10)
        thread1._stop()
Exemple #5
0
def redis_worker():
	myredis.connect2redis(host='127.0.0.1')
	mysql_init()
	while True:
		db_name = myredis.redis_q.get('BiglogDomainDB')
		DomainDB.db_exists(db_name)
Exemple #6
0
def redis_logs2sql():
	mysql_init()
	myredis.connect2redis(host='127.0.0.1')
	while True:
		sql_cmd = myredis.redis_q.get('BiglogSql')
		biglog_mysql.mysql_instance.insert_log(sql_cmd)
Exemple #7
0
def main():
	connect2gearman()
	connect2redis(host='127.0.0.1')
	biglog_rv = RecvLog.recv_udp_log()
Exemple #8
0
def main():
    connect2gearman()
    connect2redis(host='127.0.0.1')
    biglog_rv = RecvLog.recv_udp_log()