From 53e62021f8ff82fc2e7cb8404feb252e0cc2c834 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 2 May 2017 14:48:48 +0300 Subject: [PATCH] log the time the inspect action took --- .../codeInspection/ex/GlobalInspectionContextImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index 4b2ee4af5a60..17a6294d4521 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -104,6 +104,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp private volatile InspectionResultsView myView; private Content myContent; private volatile boolean myViewClosed = true; + private long myInspectionStartedTimestamp; @NotNull private AnalysisUIOptions myUIOptions; @@ -346,7 +347,8 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp protected void notifyInspectionsFinished(final AnalysisScope scope) { if (ApplicationManager.getApplication().isUnitTestMode()) return; UIUtil.invokeLaterIfNeeded(() -> { - LOG.info("Code inspection finished"); + long elapsed = System.currentTimeMillis() - myInspectionStartedTimestamp; + LOG.info("Code inspection finished. Took "+elapsed+"ms"); if (getProject().isDisposed()) return; InspectionResultsView view = myView == null ? new InspectionResultsView(this, createContentProvider()) : null; @@ -372,6 +374,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp @Override protected void runTools(@NotNull final AnalysisScope scope, boolean runGlobalToolsOnly, boolean isOfflineInspections) { + myInspectionStartedTimestamp = System.currentTimeMillis(); final ProgressIndicator progressIndicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); if (progressIndicator == null) { throw new IncorrectOperationException("Must be run under progress");