code: def wite_to_json(self, dir_path="", file_name=""):
          
          # 提取数据
          data = {
              "plot_data": self.record_thread.profile_data,
              "method_exec_info": self.method_exec_info,
              "search_file": self.search_file,
              "source_file": self.source_file}
          # 写入文件
          file_path = os.path.join(dir_path, file_name)
          if not os.path.exists(dir_path):
              os.makedirs(dir_path)
          json.dump(data, open(file_path, "w+"), indent=4)
docs: 将性能数据写入文件.