From 8114a3bc642c05d1dc86d83308b56c57c434fb6a Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 13 Jun 2019 15:41:15 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-17988=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=80=9F=E5=BA=A6&=E9=97=AA=E9=80=80=201?= =?UTF-8?q?=E3=80=81=E6=8F=90=E4=BE=9B=E5=B9=B6=E8=A1=8Cactivator=202?= =?UTF-8?q?=E3=80=81=E6=89=93=E5=8D=B0=E5=90=AF=E5=8A=A8=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=94=A8=E4=BA=8E=E5=90=8E=E9=9D=A2=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/Designer.java | 11 ++++++++--- .../java/com/fr/start/module/DesignerStartup.java | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 2c8e030e31..654f396c84 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -21,6 +21,7 @@ import com.fr.design.gui.ibutton.UIPreviewButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itoolbar.UILargeToolbar; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.InformationCollector; @@ -49,6 +50,7 @@ import com.fr.stable.lifecycle.LifecycleFatalError; import com.fr.stable.xml.XMLTools; import com.fr.start.module.StartupArgs; import com.fr.start.server.ServerTray; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; import com.fr.workspace.WorkContext; import javax.swing.JComponent; @@ -92,7 +94,9 @@ public class Designer extends BaseDesigner { * @param args 参数 */ public static void main(String[] args) { - + + StopWatch watch = new StopWatch(); + watch.start(); //启动运行时 FineRuntime.start(); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); @@ -102,7 +106,7 @@ public class Designer extends BaseDesigner { designerRoot.start(); } catch (LifecycleFatalError fatal) { SplashContext.getInstance().hide(); - JOptionPane.showMessageDialog(null, fatal.getMessage(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, fatal.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); System.exit(0); } @@ -111,7 +115,8 @@ public class Designer extends BaseDesigner { //初始化一下serverTray ServerTray.init(); } - + FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", watch.getTime()); + watch.stop(); } /** diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 4a3db7b2cc..a816769794 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -5,6 +5,7 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.Listener; +import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.Metrics; @@ -14,6 +15,7 @@ import com.fr.start.ServerStarter; import com.fr.start.SplashContext; import com.fr.start.server.FineEmbedServer; import com.fr.startup.activators.BasicActivator; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; @@ -49,14 +51,19 @@ public class DesignerStartup extends Activator { FineEmbedServer.start(); } }); + final StopWatch watch = new StopWatch(); service.submit(new Runnable() { @Override public void run() { try { + + watch.start(); designer.show(args); } finally { DesignerContext.getDesignerFrame().getProgressDialog().dispose(); + FineLoggerFactory.getLogger().info("Designer showed.Time used {} ms", watch.getTime()); + watch.stop(); } } });