def get_fps_data(package_name, pic_name='fps'):
        # 处理可能有问题的场景
        def handle_error_data(jank_count, fps):
            # 暂时当fps < 50 或者 jank_count > 10 我们认为是不达标的
            if fps < 50 or jank_count > 10:
                # 截图
                AdbUtil.screenshot(pic_name)
                # 保存日志

        # 死循环,满足条件后跳出
        exec_count = 0
        while True:
            LogUtil.log_i('get fps data')
            # 判断执行了多少次
            if exec_count > config.collect_data_count:
                break

            # 采集数据
            frame_count, jank_count, fps = AndroidUtil.get_fps_data_by_gfxinfo(package_name)
            if frame_count is None and jank_count is None and fps is None:
                exec_count += 1
                continue
            current_page = AndroidUtil.get_cur_activity()
            PerformanceControl.fps_datas.append([frame_count, jank_count, fps, current_page])

            # 处理有问题的数据
            handle_error_data(jank_count, fps)
            exec_count += 1

            # 采集数据时间间隔
            time.sleep(config.collect_data_interval)
    def run(self):
        # 处理可能有问题的场景
        def handle_error_data(frame_count, jank_count, fps, current_page):
            # 暂时当fps < 50 或者 jank_count > 10 我们认为是不达标的
            if fps < 50 or jank_count > 10:
                # 截图
                AdbUtil.screenshot(self.pic_name)
                # 保存日志

                GetFpsDataThread.fps_error_datas.append([
                    frame_count, jank_count, fps, current_page, self.pic_name
                ])

        # 死循环,满足条件后跳出
        exec_count = 0
        while True:
            log.log_i('get fps data')
            # 判断执行了多少次
            if exec_count > config.collect_data_count:
                break

            # 采集数据
            frame_count, jank_count, fps = AndroidUtil.get_fps_data_by_gfxinfo(
                self.package_name)
            if frame_count is None and jank_count is None and fps is None:
                exec_count += 1
                continue
            current_page = AndroidUtil.get_cur_activity()
            GetFpsDataThread.fps_datas.append(
                [frame_count, jank_count, fps, current_page])

            # 处理有问题的数据
            handle_error_data(frame_count, jank_count, fps, current_page)
            exec_count += 1

            # 采集数据时间间隔
            time.sleep(config.collect_data_interval)
        GetFpsDataThread.task_finish = True