|
@@ -49,7 +49,6 @@ produce_video_task_count = Gauge("produce_video_task_count", 'status', ['status'
|
|
|
produce_video_task_rate = Gauge("produce_video_task_rate", 'rate', ['rate'], registry=registry)
|
|
|
produce_video_task_total = Gauge("produce_video_task_total", 'total', ['total_cnt'], registry=registry)
|
|
|
produce_video_task_sucess = Gauge("produce_video_task_sucess", 'sucess', ['sucess_cnt'], registry=registry)
|
|
|
-
|
|
|
produce_video_task_ratio = Gauge("produce_video_task_ratio", 'produce_video_ratio', ['ratio'], registry=registry)
|
|
|
|
|
|
produce_video_tts_count = Gauge("tts_aliyun_azure", 'success', ['tts_channel'], registry=registry)
|
|
@@ -186,7 +185,7 @@ def all_metric():
|
|
|
end_time = int(datetime.datetime.fromtimestamp(time_stamp).strftime('%Y%m%d%H%M%S')) * 1000000000
|
|
|
start_time = int(datetime.datetime.fromtimestamp(time_stamp-300).strftime('%Y%m%d%H%M%S')) * 1000000000
|
|
|
print(start_time, end_time)
|
|
|
- query_sql = ("select totalCount , (successCount+processingCount1), round((successCount + processingCount1)/totalCount * 100,2) from "
|
|
|
+ query_sql = ("select totalCount , (successCount+processingCount1), round((successCount + processingCount1)/totalCount * 100,2), processingCount1 from "
|
|
|
"(select count(*) as totalCount,"
|
|
|
"sum(case when produce_status in (5,6,7,8) then 1 else 0 end) as successCount,"
|
|
|
"sum(case when produce_status = 99 then 1 else 0 end) as failCount , "
|
|
@@ -212,12 +211,14 @@ def all_metric():
|
|
|
if total_cnt == 0:
|
|
|
rate = 100
|
|
|
else:
|
|
|
- rate = (success_cnt/total_cnt) *100
|
|
|
+ rate = round((success_cnt/total_cnt),2)*100
|
|
|
+ if res[3] is not None:
|
|
|
+ process_cnt = res[3]
|
|
|
|
|
|
produce_video_task_rate.labels("produce_video_task_rate").set(rate)
|
|
|
produce_video_task_total.labels('total_cnt').set(total_cnt)
|
|
|
produce_video_task_sucess.labels('success_cnt').set(success_cnt)
|
|
|
-
|
|
|
+ produce_video_task_count.labels('process_cnt').set(process_cnt)
|
|
|
|
|
|
|
|
|
|
|
@@ -242,9 +243,9 @@ def all_metric():
|
|
|
if res[2]:
|
|
|
fail_cnt = res[2]
|
|
|
produce_video_task_count.labels("fail").set(fail_cnt)
|
|
|
- if res[3]:
|
|
|
- process_cnt = res[3]
|
|
|
- produce_video_task_count.labels("process").set(process_cnt)
|
|
|
+ # if res[3]:
|
|
|
+ # process_cnt = res[3]
|
|
|
+ # produce_video_task_count.labels("process").set(process_cnt)
|
|
|
if res[4]:
|
|
|
r1 = res[4]
|
|
|
produce_video_task_ratio.labels("<0.5").set(r1)
|