panwang 3 سال پیش
والد
کامیت
9467605f74
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      app.py

+ 8 - 0
app.py

@@ -52,6 +52,10 @@ produce_video_task_ratio = Gauge("produce_video_task_ratio", 'produce_video_rati
 
 produce_video_tts_count = Gauge("produce_video_tts_count", 'success', ['tts_channel'], registry=registry)
 produce_video_tts_ratio = Gauge("produce_video_tts_ratio", 'ratio', ['channel'], registry=registry)
+produce_video_tts_count_5m = Gauge("produce_video_tts_count", 'success', ['tts_channel'], registry=registry)
+
+
+
 logs_app_recommend_log_cnt_300 = Gauge("logs_app_recommend_log_null_cnt_300", "null cnt", ['cnt'], registry=registry)
 logs_app_recommend_log_cnt_all = Counter("logs_app_recommend_log_null_cnt_all", "all cnt", ['cnt'], registry=registry)
 
@@ -316,24 +320,28 @@ def all_metric():
         aliyun_success = int(res[0]["count"])
     else:
         aliyun_success = 0
+    produce_video_tts_count.labels("aliyun_success_5m").set(aliyun_success)
 
     res = logs_tts_ratio("aliyun", 0)
     if res is not None:
         aliyun_fail = int(res[0]["count"])
     else:
         aliyun_fail = 0
+    produce_video_tts_count.labels("aliyun_fail_5m").set(aliyun_fail)
 
     res = logs_tts_ratio("azure", 1)
     if res is not None:
         azure_success = int(res[0]["count"])
     else:
         azure_success = 0
+    produce_video_tts_count.labels("azure_success_5m").set(azure_success)
 
     res = logs_tts_ratio("azure", 0)
     if res is not None:
         azure_fail = int(res[0]["count"])
     else:
         azure_fail = 0
+    produce_video_tts_count.labels("azure_fail_5m").set(azure_fail)
 
 
     aliyun_cnt = aliyun_success + aliyun_fail