From 3e36ba544cb2020c5d96edcded6f29e2ef6af251 Mon Sep 17 00:00:00 2001 From: "yineng.huang" Date: Fri, 12 Jul 2024 11:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3ios=E4=B8=80=E5=8F=B0?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=90=8C=E6=97=B6=E5=AD=98=E5=9C=A8=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E7=BA=BF=E7=A8=8B=E8=8E=B7=E5=8F=96=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/AndroidDebuggerServiceImpl.java | 2 ++ .../service/IosDebuggerServiceImpl.java | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/AndroidDebuggerServiceImpl.java b/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/AndroidDebuggerServiceImpl.java index 9418373..c7b58e0 100644 --- a/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/AndroidDebuggerServiceImpl.java +++ b/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/AndroidDebuggerServiceImpl.java @@ -129,6 +129,7 @@ public class AndroidDebuggerServiceImpl extends AbstractDebuggerService { androidDeviceInfoByPackageThread = new AndroidDeviceInfoByPackageThread(info); androidDeviceInfoByPackageThread.start(); queryDeviceInfoByPackageMap.put(info.getDeviceId(), androidDeviceInfoByPackageThread); + logger.debug("记录设备【{}】的应用的性能在任务【{}】中已经开启完毕..................................", info.getDeviceId(),info.getCaseId()); AndroidDeviceAllInfoThread androidDeviceAllInfoThread = queryDeviceInfoMap.get(info.getCaseId()); if (androidDeviceAllInfoThread != null ) { logger.debug("记录设备【{}】的性能数据,任务【{}】已经存在。。。。。。。。。。", info.getDeviceId(),info.getCaseId()); @@ -139,6 +140,7 @@ public class AndroidDebuggerServiceImpl extends AbstractDebuggerService { androidDeviceAllInfoThread = new AndroidDeviceAllInfoThread(info); androidDeviceAllInfoThread.start(); queryDeviceInfoMap.put(info.getCaseId(), androidDeviceAllInfoThread); + logger.debug("记录设备【{}】的性能在任务【{}】中已经开启完毕..................................", info.getDeviceId(),info.getCaseId()); return true; } diff --git a/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/IosDebuggerServiceImpl.java b/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/IosDebuggerServiceImpl.java index 47fe1c9..5b7ab8b 100644 --- a/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/IosDebuggerServiceImpl.java +++ b/cctp-atu/atu-upper-computer/src/main/java/net/northking/cctp/upperComputer/service/IosDebuggerServiceImpl.java @@ -338,23 +338,27 @@ public class IosDebuggerServiceImpl extends AbstractDebuggerService { @Override public boolean recordDevicePer(DebuggerDeviceInfo info) { IOSDeviceInfoByPackageThread iosDeviceInfoByPackageThread = queryDeviceInfoByPackageMap.get(info.getCaseId()); - if (null == iosDeviceInfoByPackageThread || !iosDeviceInfoByPackageThread.isAlive() || iosDeviceInfoByPackageThread.isInterrupted()) { - logger.debug("开始记录任务id【{}】的应用的参数。。。。。。。。。。", info.getCaseId()); - iosDeviceInfoByPackageThread = new IOSDeviceInfoByPackageThread(info); - iosDeviceInfoByPackageThread.start(); - queryDeviceInfoByPackageMap.put(info.getCaseId(), iosDeviceInfoByPackageThread); + if (null != iosDeviceInfoByPackageThread) { + logger.debug("记录设备【{}】的应用的性能在任务【{}】中已经存在,干掉上一个。。。。。。。。。。", info.getDeviceId(),info.getCaseId()); + iosDeviceInfoByPackageThread.stopThread(); } else { - logger.debug("任务id【{}】的应用的参数线程存在,无需创建。。。。。。。。。。", info.getCaseId()); + logger.debug("记录设备【{}】的应用的性能线程不存在。。。。。。。。。。", info.getDeviceId()); } + iosDeviceInfoByPackageThread = new IOSDeviceInfoByPackageThread(info); + iosDeviceInfoByPackageThread.start(); + queryDeviceInfoByPackageMap.put(info.getCaseId(), iosDeviceInfoByPackageThread); + logger.debug("记录设备【{}】的应用的性能在任务【{}】中已经开启完毕..................................", info.getDeviceId(),info.getCaseId()); IOSDeviceAllInfoThread deviceAllInfoThread = queryDeviceInfoMap.get(info.getCaseId()); - if (null == deviceAllInfoThread || !deviceAllInfoThread.isAlive() || deviceAllInfoThread.isInterrupted()) { - logger.debug("开始记录任务id【{}】的设备的参数。。。。。。。。。。", info.getCaseId()); - deviceAllInfoThread = new IOSDeviceAllInfoThread(info,iosDeviceInfoByPackageThread.getDeviceCpuNum()); - deviceAllInfoThread.start(); - queryDeviceInfoMap.put(info.getCaseId(), deviceAllInfoThread); + if (null != deviceAllInfoThread) { + logger.debug("记录设备【{}】的性能数据,任务【{}】已经存在。。。。。。。。。。", info.getDeviceId(),info.getCaseId()); + deviceAllInfoThread.stopThread(); } else { - logger.debug("任务id【{}】的设备的参数线程存在,无需创建。。。。。。。。。。", info.getCaseId()); + logger.debug("记录设备【{}】性能线程不存在。。。。。。。。。。", info.getDeviceId()); } + deviceAllInfoThread = new IOSDeviceAllInfoThread(info,iosDeviceInfoByPackageThread.getDeviceCpuNum()); + deviceAllInfoThread.start(); + queryDeviceInfoMap.put(info.getCaseId(), deviceAllInfoThread); + logger.debug("记录设备【{}】的性能在任务【{}】中已经开启完毕..................................", info.getDeviceId(),info.getCaseId()); return true; } }