Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -20,5 +20,5 @@ for doc in es206_client.scan_by_sql("select code from fangjia_log where code >=
|
|||||||
count += 1
|
count += 1
|
||||||
if count > 2:
|
if count > 2:
|
||||||
print('【OPEN日志监控】最近两分钟超过两条错误,请检查日志!')
|
print('【OPEN日志监控】最近两分钟超过两条错误,请检查日志!')
|
||||||
dingutils.send_text('最近两分钟超过两条错误,请检查OPEN日志!', 'ab4231000995a8c90d8d1e91dfd6930c3896dd1c3bbf1f0af19e19004cf6c98c')
|
dingutils.send_text('【OPEN日志监控】最近两分钟超过两条错误,请检查OPEN日志!', 'ab4231000995a8c90d8d1e91dfd6930c3896dd1c3bbf1f0af19e19004cf6c98c')
|
||||||
break
|
break
|
||||||
@@ -14,6 +14,8 @@ last_day = last.strftime('%Y%m%d')
|
|||||||
|
|
||||||
log.info(f"系统当前时间 : {now}")
|
log.info(f"系统当前时间 : {now}")
|
||||||
|
|
||||||
|
|
||||||
|
def proc():
|
||||||
# 区域维度,统计2个月内样本数据量
|
# 区域维度,统计2个月内样本数据量
|
||||||
es206_client = ElasticSearchClient(host='192.168.0.206')
|
es206_client = ElasticSearchClient(host='192.168.0.206')
|
||||||
sql = 'select city,region,p_date,cat,root from seawater where cat = \'sell\' and p_date >=' + str(
|
sql = 'select city,region,p_date,cat,root from seawater where cat = \'sell\' and p_date >=' + str(
|
||||||
@@ -94,6 +96,10 @@ if df_root_city_res.empty == False:
|
|||||||
path = "/home/airflow/data/jh/price"
|
path = "/home/airflow/data/jh/price"
|
||||||
file_name = f"{now_day}房源样本数量检测.xlsx"
|
file_name = f"{now_day}房源样本数量检测.xlsx"
|
||||||
air_file_name = path + '/' + file_name
|
air_file_name = path + '/' + file_name
|
||||||
|
return text, air_file_name, df_region_res, df_root_city_res, df_root_res, file_name, count_old, count_new
|
||||||
|
|
||||||
|
|
||||||
|
text, air_file_name, df_region_res, df_root_city_res, df_root_res, file_name, count_old, count_new = proc()
|
||||||
|
|
||||||
|
|
||||||
def up_to_nextcloud():
|
def up_to_nextcloud():
|
||||||
@@ -111,12 +117,12 @@ def up_to_nextcloud():
|
|||||||
|
|
||||||
if text != '':
|
if text != '':
|
||||||
with pd.ExcelWriter(air_file_name) as writer:
|
with pd.ExcelWriter(air_file_name) as writer:
|
||||||
if df_region_res.empty == False:
|
if not df_region_res.empty:
|
||||||
df_region_res.to_excel(writer, sheet_name="房源样本数量检测-区域维度", columns=["city", "region", 'count'], index=False)
|
df_region_res.to_excel(writer, sheet_name="房源样本数量检测-区域维度", columns=["city", "region", 'count'], index=False)
|
||||||
if df_root_city_res.empty == False:
|
if not df_root_city_res.empty:
|
||||||
df_root_city_res.to_excel(writer, sheet_name="房源样本数量检测-房源网站维度(样本数)", columns=['root', 'city', 'count'],
|
df_root_city_res.to_excel(writer, sheet_name="房源样本数量检测-房源网站维度(样本数)", columns=['root', 'city', 'count'],
|
||||||
index=False)
|
index=False)
|
||||||
if df_root_res.empty == False:
|
if not df_root_res.empty:
|
||||||
df_root_res.to_excel(writer, sheet_name="房源样本数量检测-房源网站维度(样本减少百分比)", columns=['root', count_old, count_new],
|
df_root_res.to_excel(writer, sheet_name="房源样本数量检测-房源网站维度(样本减少百分比)", columns=['root', count_old, count_new],
|
||||||
index=False)
|
index=False)
|
||||||
up_to_nextcloud()
|
up_to_nextcloud()
|
||||||
|
|||||||
Reference in New Issue
Block a user