Commit a49d8d21 authored by litaolemo's avatar litaolemo

update

parent 86bce719
...@@ -19,12 +19,16 @@ redis_old_mimas = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN3@172.16.40 ...@@ -19,12 +19,16 @@ redis_old_mimas = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN3@172.16.40
class Parse_data: class Parse_data:
def __init__(self,top=2000,consume=500): def __init__(self,top=200,consume=500):
self.top = top
self.consume = consume
self.offset_dict = {} self.offset_dict = {}
def parse(self,key_name,len_data,per_sec=10): def parse(self,key_name,len_data,per_sec=10):
now = datetime.datetime.now() now = datetime.datetime.now()
time_ts = now.strftime("%Y-%m-%d %H:%M:%S") time_ts = now.strftime("%Y-%m-%d %H:%M:%S")
if len_data <= self.top:
return None
if self.offset_dict.get(key_name): if self.offset_dict.get(key_name):
old_len_data = self.offset_dict.get(key_name) old_len_data = self.offset_dict.get(key_name)
len_data_diff = old_len_data - len_data len_data_diff = old_len_data - len_data
...@@ -54,6 +58,7 @@ if __name__ == "__main__": ...@@ -54,6 +58,7 @@ if __name__ == "__main__":
rules = Parse_data() rules = Parse_data()
redis_clicnt_dct = { redis_clicnt_dct = {
"gaia-dbmw": redis_old_gaia, "gaia-dbmw": redis_old_gaia,
"tapir-gaia-service": redis_old_gaia,
"mimas-dbmw":redis_old_mimas "mimas-dbmw":redis_old_mimas
} }
per_sec = 10 per_sec = 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment