mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
[jps] Collect time spend in pre-compile tasks in FUS
#IDEA-344147 GitOrigin-RevId: e2b6fa748c0f4dc7db61fd649c8005efe5ccbd75
This commit is contained in:
committed by
intellij-monorepo-bot
parent
85d737236e
commit
10f58f919d
@@ -7,7 +7,13 @@ import com.intellij.internal.statistic.eventLog.events.EventId1;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector;
|
||||
|
||||
public final class BuildUsageCollector extends CounterUsagesCollector {
|
||||
private static final EventLogGroup GROUP = new EventLogGroup("build.jps", 2);
|
||||
private static final EventLogGroup GROUP = new EventLogGroup("build.jps", 3);
|
||||
|
||||
private static final EventId1<Long> PRE_COMPILE_BEFORE_TASKS_COMPLETED =
|
||||
GROUP.registerEvent("precompile.before.tasks.completed", EventFields.DurationMs);
|
||||
private static final EventId1<Long> PRE_COMPILE_AFTER_TASKS_COMPLETED =
|
||||
GROUP.registerEvent("precompile.after.tasks.completed", EventFields.DurationMs);
|
||||
|
||||
private static final EventId1<Long> REBUILD_COMPLETED = GROUP.registerEvent("rebuild.completed", EventFields.DurationMs);
|
||||
private static final EventId1<Long> BUILD_COMPLETED = GROUP.registerEvent("build.completed", EventFields.DurationMs);
|
||||
private static final EventId1<Long> AUTO_BUILD_COMPLETED = GROUP.registerEvent("autobuild.completed", EventFields.DurationMs);
|
||||
@@ -17,7 +23,11 @@ public final class BuildUsageCollector extends CounterUsagesCollector {
|
||||
return GROUP;
|
||||
}
|
||||
|
||||
public static void logPreCompileCompleted(long durationMs, boolean beforeTasks) {
|
||||
(beforeTasks ? PRE_COMPILE_BEFORE_TASKS_COMPLETED : PRE_COMPILE_AFTER_TASKS_COMPLETED).log(durationMs);
|
||||
}
|
||||
|
||||
public static void logBuildCompleted(long durationMs, boolean isRebuild, boolean isAutomake) {
|
||||
(isAutomake? AUTO_BUILD_COMPLETED : isRebuild? REBUILD_COMPLETED : BUILD_COMPLETED).log(durationMs);
|
||||
(isAutomake ? AUTO_BUILD_COMPLETED : isRebuild ? REBUILD_COMPLETED : BUILD_COMPLETED).log(durationMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -643,6 +643,7 @@ public final class CompileDriver {
|
||||
try {
|
||||
List<CompileTask> tasks = beforeTasks ? manager.getBeforeTasks() : manager.getAfterTaskList();
|
||||
if (!tasks.isEmpty()) {
|
||||
final long startDuration = System.currentTimeMillis();
|
||||
progressIndicator.setText(
|
||||
JavaCompilerBundle.message(beforeTasks ? "progress.executing.precompile.tasks" : "progress.executing.postcompile.tasks")
|
||||
);
|
||||
@@ -662,6 +663,8 @@ public final class CompileDriver {
|
||||
);
|
||||
}
|
||||
}
|
||||
final long endDuration = System.currentTimeMillis();
|
||||
BuildUsageCollector.logPreCompileCompleted(endDuration - startDuration, beforeTasks);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user