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; } }