| | |
| | | """ |
| | | 华鑫目标代码管理 |
| | | """ |
| | | import io |
| | | import json |
| | | import logging |
| | | import queue |
| | | import socket |
| | | import time |
| | | |
| | | from line_profiler import LineProfiler |
| | | |
| | | import constant |
| | | from code_attribute import global_data_loader, code_volumn_manager, first_target_code_data_processor |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | | from db import redis_manager |
| | |
| | | flist.append(fitem) |
| | | print("首板代码数量", len(flist)) |
| | | try: |
| | | tick_datas = first_target_code_data_processor.process_first_codes_datas(flist) |
| | | # 分析时间 |
| | | lp = LineProfiler() |
| | | lp.enable() |
| | | lp_wrap = lp(first_target_code_data_processor.process_first_codes_datas) |
| | | tick_datas = lp_wrap(flist) |
| | | output = io.StringIO() |
| | | lp.print_stats(stream=output) |
| | | lp.disable() |
| | | with open(f"{constant.get_path_prefix()}/logs/profile/first_target_code_data_processor_{int(time.time())}.txt", 'w') as f: |
| | | f.write(output.getvalue()) |
| | | |
| | | # tick_datas = first_target_code_data_processor.process_first_codes_datas(flist) |
| | | current_price_process_manager.accept_prices(tick_datas) |
| | | except Exception as e: |
| | | logging.exception(e) |