Commit bf681978 authored by 段英荣's avatar 段英荣

modify

parent 7910ecd9
......@@ -223,10 +223,10 @@ class ESPerform(object):
try:
item_list = item.split(" ")
if len(item_list)>4:
cpu_load_1m = item_list[4]
if float(cpu_load_1m) > 50:
cpu_load = item_list[3]
if int(cpu_load) > 60:
high_num += 1
es_nodes_list.append(float(cpu_load_1m))
es_nodes_list.append(int(cpu_load))
except:
logging.error("catch exception,item:%s,err_msg:%s" % (str(item),traceback.format_exc()))
return True
......
......@@ -170,11 +170,11 @@ def home_recommend(device_id="", user_id=-1, offset=0, size=10, query_type=Topic
recommend_topic_ids = list()
es_node_load_high_flag = False
# try:
# es_node_load_high_flag = ESPerform.if_es_node_load_high(ESPerform.get_cli())
# except:
# logging.error("catch exception,err_msg:%s" % traceback.format_exc())
# es_node_load_high_flag = True
try:
es_node_load_high_flag = ESPerform.if_es_node_load_high(ESPerform.get_cli())
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
es_node_load_high_flag = True
if es_node_load_high_flag:
temp_downgrading_key = "physical:home_recommend:user_id:241407656:query_type:1"
......
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