Prechádzať zdrojové kódy

匹配率监测上线

罗俊辉 11 mesiacov pred
rodič
commit
46b052a557
2 zmenil súbory, kde vykonal 7 pridanie a 6 odobranie
  1. 6 5
      match_rate_app.py
  2. 1 1
      test.py

+ 6 - 5
match_rate_app.py

@@ -23,7 +23,7 @@ def job():
     result_list = MR.match_rate(start_time_stamp=s_time, end_time_stamp=e_time)
     result_obj = RD.rate_and_error_list(result_list)
     rate_list = [
-        datetime.utcfromtimestamp(s_time).strftime("%Y%m%d"),
+        datetime.utcfromtimestamp(e_time / 1000).strftime("%Y%m%d"),
         result_obj['total_count'],
         result_obj['success_count'],
         result_obj['success_count'] / result_obj['total_count'] if result_obj['total_count'] else None,
@@ -45,7 +45,8 @@ def job():
 
 
 if __name__ == '__main__':
-    schedule.every().day.at("01:00").do(job)
-    while True:
-        schedule.run_pending()
-        time.sleep(1)
+    job()
+    # schedule.every().day.at("01:00").do(job)
+    # while True:
+    #     schedule.run_pending()
+    #     time.sleep(1)

+ 1 - 1
test.py

@@ -29,7 +29,7 @@ from functions import RateDetail, MatchRate
 
 M = MatchRate()
 R = RateDetail()
-time_stamp_list = M.generate_stamp_list("20240528", "20240529")
+time_stamp_list = M.generate_stamp_list("20240529", "20240530")
 df = []
 for item in time_stamp_list:
     s_d = int(item)