From 64e3a7e0ff73f1c9e5cba442a86254de4242a7ac Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 17 八月 2023 14:35:41 +0800
Subject: [PATCH] 删除redis日志与时间日志

---
 l2/l2_data_manager_new.py |  104 +++++++++++++++++++++++++++------------------------
 1 files changed, 55 insertions(+), 49 deletions(-)

diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py
index 9668068..3df868c 100644
--- a/l2/l2_data_manager_new.py
+++ b/l2/l2_data_manager_new.py
@@ -271,9 +271,9 @@
                     # 淇濆瓨鏁版嵁
                     __start_time = round(t.time() * 1000)
                     l2.l2_data_util.save_l2_data(code, datas, add_datas)
-                    __start_time = l2_data_log.l2_time(code,
-                                                       round(t.time() * 1000) - __start_time,
-                                                       "淇濆瓨鏁版嵁鏃堕棿锛坽}锛�".format(len(add_datas)))
+                    # __start_time = l2_data_log.l2_time(code,
+                    #                                    round(t.time() * 1000) - __start_time,
+                    #                                    "淇濆瓨鏁版嵁鏃堕棿锛坽}锛�".format(len(add_datas)))
         finally:
             if code in cls.unreal_buy_dict:
                 cls.unreal_buy_dict.pop(code)
@@ -325,9 +325,10 @@
             logger_l2_error.exception(f"code:{code}")
             logger_l2_error.exception(e)
         finally:
-            l2_data_log.l2_time(code, round(t.time() * 1000) - origin_start_time,
-                                "l2鏁版嵁澶勭悊鎬昏�楁椂",
-                                True)
+            # l2_data_log.l2_time(code, round(t.time() * 1000) - origin_start_time,
+            #                     "l2鏁版嵁澶勭悊鎬昏�楁椂",
+            #                     True)
+            pass
             if datas:
                 l2.l2_data_util.save_l2_data(code, None, datas)
 
@@ -351,8 +352,8 @@
                         limit_up_time_manager.LimitUpTimeManager().save_limit_up_time(code, "09:30:00")
 
         total_datas = local_today_datas[code]
-        __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
-                                           "l2鏁版嵁棰勫鐞嗘椂闂�")
+        # __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
+        #                                    "l2鏁版嵁棰勫鐞嗘椂闂�")
 
         if len(add_datas) > 0:
             # 鏄惁涓洪鏉夸唬鐮�
@@ -376,8 +377,8 @@
 
             latest_time = add_datas[len(add_datas) - 1]["val"]["time"]
 
-            __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
-                                               "l2鏁版嵁鍑嗗鏃堕棿")
+            # __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
+            #                                    "l2鏁版嵁鍑嗗鏃堕棿")
             # 鏃堕棿宸笉鑳藉お澶ф墠鑳藉鐞�
             if not l2_trade_util.is_in_forbidden_trade_codes(code):
                 # 鍒ゆ柇鏄惁宸茬粡鎸傚崟
@@ -409,8 +410,8 @@
             logger_l2_process.info("code:{} 澶勭悊鏁版嵁鑼冨洿: {}-{} 澶勭悊鏃堕棿:{} 鎴浘鏃堕棿鎴筹細{}", code, add_datas[0]["index"],
                                    add_datas[-1]["index"], round(t.time() * 1000) - __start_time,
                                    capture_timestamp)
-            __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
-                                               "l2鏁版嵁澶勭悊鏃堕棿")
+            # __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
+            #                                    "l2鏁版嵁澶勭悊鏃堕棿")
 
     # 澶勭悊鏈寕鍗�
     @classmethod
@@ -418,9 +419,9 @@
         __start_time = round(t.time() * 1000)
         # 鑾峰彇闃堝��
         threshold_money, msg = cls.__get_threshmoney(code)
-        if round(t.time() * 1000) - __start_time > 10:
-            __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
-                                               "鑾峰彇m鍊兼暟鎹�楁椂")
+        # if round(t.time() * 1000) - __start_time > 10:
+        #     __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
+        #                                        "鑾峰彇m鍊兼暟鎹�楁椂")
         if True:  # end_index - start_index < 10:
             cls.__start_compute_buy(code, start_index, end_index, threshold_money, capture_time, is_first_code)
         else:
@@ -457,8 +458,8 @@
             cls.__buyL2SafeCountManager.compute_left_rate(code, start_index, end_index, total_data,
                                                           local_today_num_operate_map.get(code))
 
-            l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
-                                "宸蹭笅鍗�-鑾峰彇涔板叆淇℃伅鑰楁椂")
+            # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
+            #                     "宸蹭笅鍗�-鑾峰彇涔板叆淇℃伅鑰楁椂")
             return None, ""
 
         @dask.delayed
@@ -468,8 +469,8 @@
             # 璁$畻m鍊煎ぇ鍗�
             cls.l2BigNumForMProcessor.process(code, max(buy_single_index, start_index), end_index,
                                               gpcode_manager.get_limit_up_price(code))
-            l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
-                                "宸蹭笅鍗�-m鍊煎ぇ鍗曡绠�")
+            # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
+            #                     "宸蹭笅鍗�-m鍊煎ぇ鍗曡绠�")
             return None, ""
 
         # 涔�1鎾よ绠�
@@ -481,8 +482,8 @@
                                                                                  end_index,
                                                                                  buy_single_index, buy_exec_index)
 
-            l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
-                                "宸蹭笅鍗�-涔�1缁熻鑰楁椂")
+            # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
+            #                     "宸蹭笅鍗�-涔�1缁熻鑰楁椂")
             # 涔�1涓嶄細瑙﹀彂鎾ゅ崟
             return None, ""
             # return cancel_data, cancel_msg
@@ -508,8 +509,9 @@
                 logger_l2_error.error(f"鍙傛暟锛歜uy_single_index-{_buy_single_index} buy_exec_index-{_buy_exec_index}")
                 logger_l2_error.exception(e)
             finally:
-                l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
-                                    "宸蹭笅鍗�-s绾уぇ鍗曚及绠�")
+                # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time,
+                #                     "宸蹭笅鍗�-s绾уぇ鍗曚及绠�")
+                pass
             return None, ""
 
         # H鎾�
@@ -533,7 +535,8 @@
                 logger_l2_error.error(f"鍙傛暟锛歜uy_single_index-{_buy_single_index} buy_exec_index-{_buy_exec_index}")
                 logger_l2_error.exception(e)
             finally:
-                l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-H鎾ゅぇ鍗曡绠�")
+                # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-H鎾ゅぇ鍗曡绠�")
+                pass
             return None, ""
 
         # L鎾�
@@ -553,7 +556,8 @@
                 logger_l2_error.error(f"鍙傛暟锛歜uy_single_index-{_buy_single_index} buy_exec_index-{_buy_exec_index}")
                 logger_l2_error.exception(e)
             finally:
-                l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-L鎾ゅぇ鍗曡绠�")
+                # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-L鎾ゅぇ鍗曡绠�")
+                pass
             return None, ""
 
         # 鏉夸笂鍗栨挙
@@ -569,7 +573,8 @@
             except Exception as e:
                 logging.exception(e)
             finally:
-                l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-鏉夸笂鍗栬�楁椂")
+                # l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-鏉夸笂鍗栬�楁椂")
+                pass
             return None, ""
 
         # 鏄惁闇�瑕佹挙閿�
@@ -618,19 +623,19 @@
         if not cancel_data:
             cancel_data, cancel_msg = l_cancel(buy_single_index, buy_exec_index)
         l2_log.debug(code, "鎾ゅ崟璁$畻缁撴潫")
-        _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                          "宸蹭笅鍗�-鎾ゅ崟 鍒ゆ柇鏄惁闇�瑕佹挙鍗�")
+        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+        #                                   "宸蹭笅鍗�-鎾ゅ崟 鍒ゆ柇鏄惁闇�瑕佹挙鍗�")
         if cancel_data:
             l2_log.debug(code, "瑙﹀彂鎾ゅ崟锛屾挙鍗曚綅缃細{} 锛屾挙鍗曞師鍥狅細{}", cancel_data["index"], cancel_msg)
             l2_log.trade_record(code, "鎾ゅ崟", "'index':{} , 'msg':'{}'", cancel_data["index"], cancel_msg)
             # 鎾ゅ崟
             if cls.cancel_buy(code, cancel_msg):
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  "宸蹭笅鍗�-鎾ゅ崟 鑰楁椂")
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   "宸蹭笅鍗�-鎾ゅ崟 鑰楁椂")
                 # 鎾ゅ崟鎴愬姛锛岀户缁绠椾笅鍗�
                 cls.__process_not_order(code, cancel_data["index"] + 1, end_index, capture_time, is_first_code)
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  "澶勭悊鍓╀綑鏁版嵁 鑰楁椂")
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   "澶勭悊鍓╀綑鏁版嵁 鑰楁椂")
             else:
                 # 鎾ゅ崟灏氭湭鎴愬姛
                 pass
@@ -653,8 +658,8 @@
                 # lp.disable()
                 # logger_profile.info(output.getvalue())
 
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  "宸茶櫄鎷熶笅鍗�-鎵ц鐪熷疄涓嬪崟 澶栭儴鑰楁椂")
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   "宸茶櫄鎷熶笅鍗�-鎵ц鐪熷疄涓嬪崟 澶栭儴鑰楁椂")
 
     @classmethod
     def __buy(cls, code, capture_timestamp, last_data, last_data_index, is_first_code):
@@ -665,7 +670,7 @@
         else:
             can, need_clear_data, reason = cls.__can_buy_first(code)
 
-        __start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - __start_time, "鏈�鍚庡垽鏂槸鍚﹁兘涓嬪崟", force=True)
+        # __start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - __start_time, "鏈�鍚庡垽鏂槸鍚﹁兘涓嬪崟", force=True)
         # 鍒犻櫎铏氭嫙涓嬪崟
         if code in cls.unreal_buy_dict:
             cls.unreal_buy_dict.pop(code)
@@ -864,7 +869,8 @@
             # 鍙互涓嬪崟
             return True, False, None
         finally:
-            l2_data_log.l2_time(code, round((t.time() - __start_time) * 1000), "鏄惁鍙互涓嬪崟璁$畻")
+            # l2_data_log.l2_time(code, round((t.time() - __start_time) * 1000), "鏄惁鍙互涓嬪崟璁$畻")
+            pass
 
     @classmethod
     def __can_buy_first(cls, code):
@@ -1111,7 +1117,7 @@
                 # 濡傛灉鏄粖澶╃涓�娆℃湁涓嬪崟寮�濮嬩俊鍙凤紝闇�瑕佽缃ぇ鍗曡捣濮嬬偣
                 cls.l2BigNumForMProcessor.set_begin_pos(code, buy_single_index)
 
-        _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "涓嬪崟淇″彿璁$畻鏃堕棿")
+        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "涓嬪崟淇″彿璁$畻鏃堕棿")
 
         if buy_single_index is None:
             # 鏈幏鍙栧埌涔板叆淇″彿锛岀粓姝㈢▼搴�
@@ -1127,11 +1133,11 @@
                                           compute_end_index,
                                           gpcode_manager.get_limit_up_price(code))
 
-        _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "璁$畻m鍊煎ぇ鍗�")
+        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "璁$畻m鍊煎ぇ鍗�")
 
         threshold_money, msg = cls.__get_threshmoney(code)
 
-        _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m鍊奸槇鍊艰绠�")
+        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m鍊奸槇鍊艰绠�")
 
         # 涔板叆绾拱棰濈粺璁�
         compute_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code,
@@ -1141,7 +1147,7 @@
                                                                                                              threshold_money,
                                                                                                              buy_single_index,
                                                                                                              max_num_set)
-        _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "绾拱棰濈粺璁℃椂闂�")
+        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "绾拱棰濈粺璁℃椂闂�")
 
         l2_log.debug(code, "m鍊�-{} 閲忔瘮:{} rebegin_buy_pos:{}", threshold_money, cls.volume_rate_info[code][0],
                      rebegin_buy_pos)
@@ -1192,10 +1198,10 @@
             #                                          buy_single_index,
             #                                          buy_exec_index, False)
 
-            l2_log.debug(code, "璁板綍鎵ц涔板叆鏁版嵁缁撴潫")
+            # l2_log.debug(code, "璁板綍鎵ц涔板叆鏁版嵁缁撴潫")
 
-            _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                              "璁板綍鎵ц涔板叆鏁版嵁", force=True)
+            # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+            #                                   "璁板綍鎵ц涔板叆鏁版嵁", force=True)
 
             # 鏁版嵁鏄惁澶勭悊瀹屾瘯
             if compute_index >= compute_end_index:
@@ -1206,8 +1212,8 @@
                                                                                         cls.volume_rate_info[code][1],
                                                                                         cls.volume_rate_info[code][1],
                                                                                         True)
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  "S绾уぇ鍗曞鐞嗚�楁椂", force=True)
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   "S绾уぇ鍗曞鐞嗚�楁椂", force=True)
                 l2_log.debug(code, "鏁版嵁澶勭悊瀹屾瘯锛屼笅鍗�, 鏁版嵁鎴浘鏃堕棿-{}", capture_time)
                 # 鏁版嵁宸茬粡澶勭悊瀹屾瘯锛屽鏋滆繕娌℃挙鍗曞氨瀹為檯涓嬪崟
                 if need_cancel:
@@ -1223,8 +1229,8 @@
                                                              cls.volume_rate_info[code][1], False)
                 l2_log.debug(code, "S绾уぇ鍗曞鐞�")
 
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  "S绾уぇ鍗曞鐞嗚�楁椂", force=True)
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   "S绾уぇ鍗曞鐞嗚�楁椂", force=True)
                 # 鏁版嵁灏氭湭澶勭悊瀹屾瘯锛岃繘琛屼笅涓�姝ュ鐞�
                 l2_log.debug(code, "鏁版嵁灏氭湭澶勭悊瀹屾瘯锛岃繘琛屼笅涓�姝ュ鐞嗭紝澶勭悊杩涘害锛歿} end_index:{}", compute_index, compute_end_index)
                 # 澶勭悊鎾ゅ崟姝ラ
@@ -1238,8 +1244,8 @@
                 # lp.disable()
                 # logger_profile.info(output.getvalue())
 
-                _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
-                                                  f"澶勭悊鎾ゅ崟姝ラ鑰楁椂锛岃寖鍥达細{compute_index + 1}-{compute_end_index}", force=True)
+                # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time,
+                #                                   f"澶勭悊鎾ゅ崟姝ラ鑰楁椂锛岃寖鍥达細{compute_index + 1}-{compute_end_index}", force=True)
         else:
             # 鏈揪鍒颁笅鍗曟潯浠讹紝淇濆瓨绾拱棰濓紝璁剧疆绾拱棰�
             # 璁板綍涔板叆淇″彿浣嶇疆

--
Gitblit v1.8.0