| | |
| | | from log_module import async_log_util |
| | | from log_module.async_log_util import huaxin_l2_log |
| | | from log_module.log import logger_local_huaxin_l2_error, logger_system, logger_local_huaxin_l2_subscript, \ |
| | | logger_local_huaxin_l2_special_volume, logger_debug |
| | | logger_local_huaxin_l2_special_volume, logger_debug, logger_local_huaxin_l2_orderdetail |
| | | from utils import tool, shared_memery_util |
| | | import collections |
| | | import zmq |
| | |
| | | logger_debug.error(f"{str(e)} - min_volume-{min_volume}") |
| | | |
| | | # 过滤订单 |
| | | def __filter_order(self, item): |
| | | filter_condition = self.filter_order_condition_dict.get(item[0]) |
| | | def __filter_order(self, item, filter_condition): |
| | | |
| | | if filter_condition: |
| | | # item[2]为量 |
| | | if item[2] >= filter_condition[0][0]: |
| | |
| | | temp_list = [] |
| | | while True: |
| | | try: |
| | | filter_condition = self.filter_order_condition_dict.get(code) |
| | | while len(q) > 0: |
| | | data = q.popleft() |
| | | # 前置数据处理,过滤掉无用的数据 |
| | | data = self.__filter_order(data) |
| | | data = self.__filter_order(data, filter_condition) |
| | | if data: |
| | | temp_list.append(data) |
| | | |
| | |
| | | use_time = time.time() - __start_time |
| | | if use_time > 0.01: |
| | | # 记录10ms以上的数据 |
| | | huaxin_l2_log.info(logger_local_huaxin_l2_error, f"耗时:{use_time}s 结束数据:{last_data} 数据数量:{len(temp_list)}") |
| | | huaxin_l2_log.info(logger_local_huaxin_l2_error, |
| | | f"耗时:{use_time}s 结束数据:{last_data} 数据数量:{len(temp_list)}") |
| | | # TODO测试 ,记录所有的订单号 |
| | | huaxin_l2_log.info(logger_local_huaxin_l2_orderdetail, |
| | | f"{[(x[0], x[1], x[2], x[4], x[8]) for x in temp_list]}") |
| | | temp_list = [] |
| | | else: |
| | | if code not in self.temp_order_queue_dict: |