Browse Source

REPORT-76068【迭代】【起始页】埋点没记

- 对切换的定义做一个明确
- 补充注释
feature/x
Harrison 2 years ago
parent
commit
c984ad0633
  1. 33
      designer-base/src/main/java/com/fr/startup/metric/DesignerStartupPageStatistic.java
  2. 5
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

33
designer-base/src/main/java/com/fr/startup/metric/DesignerStartupPageStatistic.java

@ -1,7 +1,9 @@
package com.fr.startup.metric;
import com.fr.stable.StringUtils;
import com.fr.start.common.DesignerStartupContext;
import com.fr.startup.ui.StartupPageModel;
import com.fr.startup.ui.StartupWorkspaceBean;
import java.util.ArrayDeque;
import java.util.Deque;
@ -15,6 +17,9 @@ public class DesignerStartupPageStatistic {
private final Deque<Operation> operations = new ArrayDeque<>();
/**
* {@link OperationType} 的注释
*/
public void recordOpenEmptyTemplate() {
Operation operation = OperationType.DO_OPEN_EMPTY_TEMPLATE.create();
@ -24,15 +29,24 @@ public class DesignerStartupPageStatistic {
pushOperation(operation);
}
public void recordSwitchWorkspace() {
/**
* {@link OperationType} 的注释
*/
public void recordSwitchWorkspace(StartupWorkspaceBean lastWorkspaceInfo, StartupWorkspaceBean currentWorkspace) {
if (lastWorkspaceInfo != null && StringUtils.equals(lastWorkspaceInfo.getName(), currentWorkspace.getName())) {
return;
}
Operation operation = OperationType.DO_SWITCH_WORKSPACE.create();
StartupPageModel pageModel = DesignerStartupContext.getInstance().getStartupPageModel();
operation.setWorkspace(pageModel.getSelectWorkspaceInfo().getName());
operation.setWorkspace(currentWorkspace.getName());
operation.setWorkspaceNum(pageModel.getWorkspaceInfos().size());
pushOperation(operation);
}
/**
* {@link OperationType} 的注释
*/
public void recordShowAllAction() {
Operation operation = OperationType.DO_SHOW_ALL_ACTION.create();
@ -41,6 +55,9 @@ public class DesignerStartupPageStatistic {
pushOperation(operation);
}
/**
* {@link OperationType} 的注释
*/
public void recordOpenLastTemplate(String lastOpenFile) {
Operation operation = OperationType.DO_OPEN_LAST_TEMPLATE_ACTION.create();
@ -50,11 +67,21 @@ public class DesignerStartupPageStatistic {
pushOperation(operation);
}
/**
* 添加操作
*
* @param operation 操作
*/
public void pushOperation(Operation operation) {
this.operations.push(operation);
}
/**
* 获取操作
*
* @return 操作
*/
public Deque<Operation> getOperations() {
return this.operations;

5
designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

@ -547,13 +547,14 @@ public class StartupPageWorkspacePanel extends JPanel {
}
private void doSwitchWorkspace(StartupWorkspaceBean workspaceInfo) {
StartupWorkspaceBean lastWorkspaceInfo = pageModel.getSelectWorkspaceInfo();
// selectWorkspaceRunnable
pageModel.setSelectWorkspaceInfo(workspaceInfo);
selectWorkspaceRunnable.run();
DesignerMetrics designerMetrics = DesignerStartupContext.getInstance().getDesignerMetrics();
designerMetrics.getStatistic().recordSwitchWorkspace();
designerMetrics.getStatistic().recordSwitchWorkspace(lastWorkspaceInfo, workspaceInfo);
}
private void doShowAllAction(UILabel fontLabel, UILabel iconLabel) {

Loading…
Cancel
Save