panwang 3 éve
szülő
commit
763823541b
2 módosított fájl, 4 hozzáadás és 2 törlés
  1. 3 1
      app.py
  2. 1 1
      utils.py

+ 3 - 1
app.py

@@ -211,9 +211,11 @@ def all_metric():
     if  total_cnt == 0:
         rate = 100
     else:
-        rate = round((success_cnt/total_cnt),2)*100
+        rate = round((success_cnt/total_cnt), 2)*100
     if res[3] is not None:
         process_cnt = res[3]
+    else:
+        process_cnt = 0
 
     produce_video_task_rate.labels("produce_video_task_rate").set(rate)
     produce_video_task_total.labels('total_cnt').set(total_cnt)

+ 1 - 1
utils.py

@@ -499,7 +499,7 @@ def  produce_video_ratio_cnt():
     conn = pymysql.connect(host=HOST, user=USERNAME, password=PASSWORD, database=DATABASE, charset="utf8")
     cursor = conn.cursor()
     start_time = int((date.today() + timedelta(days=-1)).strftime("%Y%m%d")) * 1000000000000000
-    # end_time = int(date.today().strftime("%Y%m%d")) * 1000000000000000
+    end_time = int(date.today().strftime("%Y%m%d")) * 1000000000000000
     # end_time = int((date.today() + timedelta(days=0)).strftime("%Y%m%d")) * 1000000000000000
 
     sql = ("select count(*) as totalCount, "