mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
FUS: "indexing" and "run.configuration.exec" groups: add TERMINATED/FINISHED finish_type to finished event (IDEA-282296)
GitOrigin-RevId: 015e69b9b39dc1ee8943ad8a17572dd34f709b4e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a063cb4986
commit
d529f06db7
@@ -952,7 +952,10 @@ private class ProcessExecutionListener(private val project: Project,
|
||||
|
||||
project.messageBus.syncPublisher(ExecutionManager.EXECUTION_TOPIC).processTerminated(executorId, environment, processHandler, event.exitCode)
|
||||
|
||||
RunConfigurationUsageTriggerCollector.logProcessFinished(activity, RunConfigurationFinishType.UNKNOWN)
|
||||
val runConfigurationFinishType =
|
||||
if (event.processHandler.getUserData(ProcessHandler.TERMINATION_REQUESTED) == true) RunConfigurationFinishType.TERMINATED
|
||||
else RunConfigurationFinishType.UNKNOWN
|
||||
RunConfigurationUsageTriggerCollector.logProcessFinished(activity, runConfigurationFinishType)
|
||||
|
||||
processHandler.removeProcessListener(this)
|
||||
SaveAndSyncHandler.getInstance().scheduleRefresh()
|
||||
|
||||
@@ -32,7 +32,7 @@ import static com.intellij.execution.impl.statistics.RunConfigurationTypeUsagesC
|
||||
|
||||
public final class RunConfigurationUsageTriggerCollector extends CounterUsagesCollector {
|
||||
public static final String GROUP_NAME = "run.configuration.exec";
|
||||
private static final EventLogGroup GROUP = new EventLogGroup(GROUP_NAME, 62);
|
||||
private static final EventLogGroup GROUP = new EventLogGroup(GROUP_NAME, 63);
|
||||
private static final ObjectEventField ADDITIONAL_FIELD = EventFields.createAdditionalDataField(GROUP_NAME, "started");
|
||||
private static final StringEventField EXECUTOR = EventFields.StringValidatedByCustomRule("executor", "run_config_executor");
|
||||
/**
|
||||
@@ -160,5 +160,5 @@ public final class RunConfigurationUsageTriggerCollector extends CounterUsagesCo
|
||||
}
|
||||
}
|
||||
|
||||
public enum RunConfigurationFinishType {FAILED_TO_START, UNKNOWN}
|
||||
public enum RunConfigurationFinishType {FAILED_TO_START, UNKNOWN, TERMINATED}
|
||||
}
|
||||
|
||||
@@ -110,6 +110,10 @@ public final class ProgressSuspender implements AutoCloseable {
|
||||
return mySuspended;
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
return myClosed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reason if provided, is displayed in the UI instead of suspended text passed into constructor until the progress is resumed
|
||||
*/
|
||||
|
||||
@@ -56,6 +56,9 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static com.intellij.openapi.project.IndexingStatisticsCollector.IndexingFinishType.FINISHED;
|
||||
import static com.intellij.openapi.project.IndexingStatisticsCollector.IndexingFinishType.TERMINATED;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public class DumbServiceImpl extends DumbService implements Disposable, ModificationTracker, DumbServiceBalloon.Service {
|
||||
private static final ExtensionPointName<StartupActivity.RequiredForSmartMode> REQUIRED_FOR_SMART_MODE_STARTUP_ACTIVITY
|
||||
@@ -632,7 +635,7 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
|
||||
//this used to be called in EDT from getNextTask(), but moved it here to simplify
|
||||
queueUpdateFinished();
|
||||
|
||||
activity.finished();
|
||||
IndexingStatisticsCollector.logProcessFinished(activity, suspender.isClosed() ? TERMINATED : FINISHED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.project
|
||||
|
||||
import com.intellij.internal.statistic.StructuredIdeActivity
|
||||
import com.intellij.internal.statistic.eventLog.EventLogGroup
|
||||
import com.intellij.internal.statistic.eventLog.events.EventFields
|
||||
import com.intellij.internal.statistic.eventLog.events.EventPair
|
||||
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
|
||||
|
||||
class IndexingStatisticsCollector : CounterUsagesCollector() {
|
||||
companion object {
|
||||
val GROUP = EventLogGroup("indexing", 5)
|
||||
@JvmStatic
|
||||
fun logProcessFinished(activity: StructuredIdeActivity?,
|
||||
finishType: IndexingFinishType) {
|
||||
activity?.finished { listOf(EventPair(FINISH_TYPE, finishType)) }
|
||||
}
|
||||
|
||||
val GROUP = EventLogGroup("indexing", 6)
|
||||
|
||||
@JvmField
|
||||
val STAGE_CLASS = EventFields.Class("stage_class")
|
||||
|
||||
@JvmField
|
||||
val INDEXING_ACTIVITY = GROUP.registerIdeActivity(null)
|
||||
val FINISH_TYPE = EventFields.Enum("finish_type", IndexingFinishType::class.java)
|
||||
@JvmField
|
||||
val INDEXING_ACTIVITY = GROUP.registerIdeActivity(null, emptyArray(), arrayOf(FINISH_TYPE))
|
||||
|
||||
@JvmField
|
||||
val INDEXING_STAGE = INDEXING_ACTIVITY.registerStage("stage", arrayOf(STAGE_CLASS, EventFields.PluginInfo))
|
||||
@@ -22,4 +32,8 @@ class IndexingStatisticsCollector : CounterUsagesCollector() {
|
||||
override fun getGroup(): EventLogGroup {
|
||||
return GROUP
|
||||
}
|
||||
|
||||
enum class IndexingFinishType {
|
||||
TERMINATED, FINISHED
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user