diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.kt index 72bea95b6307..225ec35a6925 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.kt @@ -248,7 +248,6 @@ class InfoAndProgressPanel internal constructor(private val statusBar: IdeStatus infos.add(info) val expanded = createInlineDelegate(info = info, original = original, compact = false) val compact = createInlineDelegate(info = info, original = original, compact = true) - IntegrationTestsProgressesTracker.progressStarted(original) getPopup().addIndicator(expanded) balloon.addIndicator(rootPane, compact) updateProgressIcon() @@ -261,7 +260,6 @@ class InfoAndProgressPanel internal constructor(private val statusBar: IdeStatus // already finished, progress might not send another finished message removeProgress(expanded) removeProgress(compact) - IntegrationTestsProgressesTracker.progressStopped(original) return } coroutineScope.launch { @@ -293,7 +291,6 @@ class InfoAndProgressPanel internal constructor(private val statusBar: IdeStatus return } mainPanel.removeProgress(progress, last) - IntegrationTestsProgressesTracker.progressStopped(original) coroutineScope.launch { runQuery() } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/IntegrationTestsProgressesTracker.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/IntegrationTestsProgressesTracker.kt deleted file mode 100644 index 6c38ed13dcec..000000000000 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/IntegrationTestsProgressesTracker.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.openapi.wm.impl.status - -import com.intellij.openapi.application.ApplicationManager -import com.intellij.openapi.application.ex.ApplicationManagerEx -import com.intellij.openapi.progress.ProgressModel -import com.intellij.openapi.util.text.StringUtil -import java.util.concurrent.ConcurrentHashMap -import java.util.concurrent.Future - -internal object IntegrationTestsProgressesTracker { - private val enabled = ApplicationManagerEx.isInIntegrationTest() && System.getProperty("idea.performanceReport.projectName") != null - private val lock = Object() - private val timestamps: MutableMap = ConcurrentHashMap() - - // See com.intellij.openapi.wm.impl.status.ProgressComponent.updateProgressNow - private fun getTitle(indicatorModel: ProgressModel): String { - val text = indicatorModel.getText() - return if (!StringUtil.isEmpty(text)) text!! else indicatorModel.title - } - - fun progressStarted(indicatorModel: ProgressModel) { - if (!enabled) return - synchronized(lock) { - timestamps[indicatorModel] = System.currentTimeMillis() - } - } - - fun progressTitleChanged(indicatorModel: ProgressModel, oldTextValue: String, newTextValue: String) { - if (!enabled) return - if (oldTextValue == newTextValue) return - synchronized(lock) { - val now = System.currentTimeMillis() - val was = timestamps.replace(indicatorModel, now) - if (isUnnoticeableUnnamedProgress(oldTextValue, was, now)) return - val message = createMessage(was, now, oldTextValue, indicatorModel.visibleInStatusBar, "changed message") - sendMessage(message) - } - } - - private fun createMessage(was: Long?, now: Long, text: String, visibleInStatusBar: Boolean, action: String): String { - val longer = when { - was == null -> "unknown" - was + 3000 < now -> "true" - else -> "false" - } - val timeInMillis = if (was == null) "?" else (now - was).toString() - return "Progress Indicator Test Stats:\n" + - "v2\n" + - (if (visibleInStatusBar) "Primary" else "Secondary") + "\n" + - "$action\n" + - "longer than 3 seconds: $longer\n" + - "time: $timeInMillis ms\n" + - "message: " + text.ifBlank { "" } - } - - private fun isUnnoticeableUnnamedProgress(text: String, was: Long?, now: Long): Boolean { - return text.isBlank() && was != null && (now - was < 200) - } - - fun progressStopped(indicatorModel: ProgressModel?) { - if (!enabled) return - if (indicatorModel == null) return - synchronized(lock) { - val now = System.currentTimeMillis() - val was = timestamps.remove(indicatorModel) - val title = getTitle(indicatorModel) - if (isUnnoticeableUnnamedProgress(title, was, now)) return - sendMessage(createMessage(was, now, title, indicatorModel.visibleInStatusBar, "stopped")) - } - } - - private fun sendMessage(message: String): Future<*> = ApplicationManager.getApplication().executeOnPooledThread { - throw RuntimeException(message) - } - -} \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProgressComponent.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProgressComponent.kt index 2b941b461fb8..e726ceff3db4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProgressComponent.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProgressComponent.kt @@ -183,7 +183,6 @@ open class ProgressComponent(val isCompact: Boolean, val info: TaskInfo, progres progress.setValue((fraction * 99 + 1).toInt()) } - val oldTextValue = this.textValue val text = indicatorModel.getText() val text2 = indicatorModel.getDetails() this.textValue = text ?: "" @@ -193,8 +192,6 @@ open class ProgressComponent(val isCompact: Boolean, val info: TaskInfo, progres this.textValue = indicatorModel.title } - IntegrationTestsProgressesTracker.progressTitleChanged(indicatorModel, oldTextValue?: "", this.textValue?: "") - if (this.isStopping) { if (isCompact) { this.textValue = IdeBundle.message("progress.text.stopping", this.textValue)