|
|
@ -137,22 +137,28 @@ public class EnvChangeEntrance { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean switch2Env(final String envName, PopTipStrategy strategy) { |
|
|
|
private boolean switch2Env(final String envName, PopTipStrategy strategy) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WorkspaceSwitchProcess lastProcess = WorkContext.getSwitcher().getProcess(); |
|
|
|
PerformancePoint performancePoint = PerformancePoint.create(); |
|
|
|
PerformancePoint performancePoint = PerformancePoint.create(); |
|
|
|
|
|
|
|
|
|
|
|
boolean switchStatus = doSwitch2Env(envName, strategy); |
|
|
|
boolean switchStatus = doSwitch2Env(envName, strategy); |
|
|
|
// 记录切换耗时
|
|
|
|
|
|
|
|
recordSwitchElapsed(performancePoint); |
|
|
|
WorkspaceSwitchProcess currentProcess = WorkContext.getSwitcher().getProcess(); |
|
|
|
// 触发切换埋点
|
|
|
|
// 如果相同,代表根本没切换 ==
|
|
|
|
triggerSwitchMetric(switchStatus); |
|
|
|
if (lastProcess != currentProcess) { |
|
|
|
|
|
|
|
// 记录切换耗时
|
|
|
|
|
|
|
|
recordSwitchInfos(performancePoint, switchStatus); |
|
|
|
|
|
|
|
// 触发切换埋点
|
|
|
|
|
|
|
|
triggerSwitchMetric(); |
|
|
|
|
|
|
|
} |
|
|
|
return switchStatus; |
|
|
|
return switchStatus; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 由云端运维,触发切换埋点 |
|
|
|
* 由云端运维,触发切换埋点 |
|
|
|
* 内部空实现 |
|
|
|
* 内部空实现 |
|
|
|
* |
|
|
|
* 见 <a href="https://kms.fineres.com/pages/viewpage.action?pageId=945327503">实现</a> |
|
|
|
* @param switchStatus 切换状态 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void triggerSwitchMetric(boolean switchStatus) { |
|
|
|
private void triggerSwitchMetric() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -236,12 +242,15 @@ public class EnvChangeEntrance { |
|
|
|
TemplateTreeClipboard.getInstance().reset(); |
|
|
|
TemplateTreeClipboard.getInstance().reset(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void recordSwitchElapsed(PerformancePoint performancePoint) { |
|
|
|
private static void recordSwitchInfos(PerformancePoint performancePoint, boolean switchSuccess) { |
|
|
|
|
|
|
|
|
|
|
|
performancePoint.end(elapsed -> { |
|
|
|
performancePoint.end(elapsed -> { |
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProgress(); |
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess(); |
|
|
|
Optional.ofNullable(process) |
|
|
|
Optional.ofNullable(process) |
|
|
|
.ifPresent((e) -> e.recordSwitchElapsed(elapsed)); |
|
|
|
.ifPresent((e) -> { |
|
|
|
|
|
|
|
e.recordSwitchElapsed(elapsed); |
|
|
|
|
|
|
|
e.setSwitchSuccess(switchSuccess); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|