diff --git a/platform/platform-impl/src/com/intellij/diagnostic/IdeHeartbeatEventReporter.kt b/platform/platform-impl/src/com/intellij/diagnostic/IdeHeartbeatEventReporter.kt index b1bfafbeab6f..27bdb3a0bfba 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/IdeHeartbeatEventReporter.kt +++ b/platform/platform-impl/src/com/intellij/diagnostic/IdeHeartbeatEventReporter.kt @@ -139,14 +139,14 @@ internal object UILatencyLogger : CounterUsagesCollector() { /** number of samples in this set of measurements */ private val SAMPLES_COUNT: IntEventField = IntEventField("samples") /** mean task running time, in nanoseconds */ - private val AVG_NS: DoubleEventField = DoubleEventField("avg_ns") + private val AVG_NS: FloatEventField = FloatEventField("avg_ns") /** 50%-tile of task running time, in nanoseconds */ private val P50_NS: LongEventField = LongEventField("p50_ns") //below fields values are _relative to median_: 99%/50%, 99.9%/50%, max/50% - private val P99_TO_P50: DoubleEventField = DoubleEventField("p99_to_p50") - private val P999_TO_P50: DoubleEventField = DoubleEventField("p999_to_p50") - private val MAX_TO_P50: DoubleEventField = DoubleEventField("max_to_p50") + private val P99_TO_P50: FloatEventField = FloatEventField("p99_to_p50") + private val P999_TO_P50: FloatEventField = FloatEventField("p999_to_p50") + private val MAX_TO_P50: FloatEventField = FloatEventField("max_to_p50") private val RESPONSIVENESS_EVENT: VarargEventId = GROUP.registerVarargEvent( "responsiveness", @@ -160,12 +160,12 @@ internal object UILatencyLogger : CounterUsagesCollector() { RESPONSIVENESS_EVENT.log( SAMPLES_COUNT.with(samplesCount), - AVG_NS.with(avg_ns), + AVG_NS.with(avg_ns.toFloat()), P50_NS.with(p50_ns), - P99_TO_P50.with(p99_ns * 1.0 / p50_ns), - P999_TO_P50.with(p999_ns * 1.0 / p50_ns), - MAX_TO_P50.with(max_ns * 1.0 / p50_ns) + P99_TO_P50.with((p99_ns * 1.0 / p50_ns).toFloat()), + P999_TO_P50.with((p999_ns * 1.0 / p50_ns).toFloat()), + MAX_TO_P50.with((max_ns * 1.0 / p50_ns).toFloat()) ) } diff --git a/platform/platform-impl/src/com/intellij/diagnostic/JVMResponsivenessMonitor.java b/platform/platform-impl/src/com/intellij/diagnostic/JVMResponsivenessMonitor.java index a43cc1d6c277..719bb6ae273a 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/JVMResponsivenessMonitor.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/JVMResponsivenessMonitor.java @@ -16,7 +16,7 @@ import static com.intellij.util.SystemProperties.getIntProperty; * Follows an idea of jhiccup tool: monitors * general JVM responsiveness by periodically run a sample CPU/memory-bound task and measure * its run time. - * Creates a histogram over task run distribution, and reports a few chosen statistics + * Creates a histogram over task run duration distribution, and reports a few chosen statistics * (avg, max, 50-99-99.9%-tile...) to FUS, as 'performance:responsiveness' event *

* The goal is to estimate how many 'hiccups' -- tail-delays in ordinary CPU/memory-bound @@ -45,15 +45,15 @@ public final class JVMResponsivenessMonitor implements Disposable, AutoCloseable // 3. GC pauses: probably, the most important for JVM threads, and a something we have at least // some means to deal with - private static final int SAMPLING_PERIOD_MS = getIntProperty("JVMResponsivenessMonitor.SAMPLING_PERIOD_MS", 500); - /** Should be >1000 for 99.9% to make any sense */ - private static final int REPORTING_EACH_N_SAMPLES = getIntProperty("JVMResponsivenessMonitor.REPORTING_EACH_N_SAMPLES", 2000); + private static final int SAMPLING_PERIOD_MS = getIntProperty("JVMResponsivenessMonitor.SAMPLING_PERIOD_MS", 1_000); + /** Should be >1000 for 99.9%-ile to make any sense */ + private static final int REPORTING_EACH_N_SAMPLES = getIntProperty("JVMResponsivenessMonitor.REPORTING_EACH_N_SAMPLES", 3600); private static final int MEMORY_BUFFER_SIZE = getIntProperty("JVMResponsivenessMonitor.MEMORY_BUFFER_SIZE", 512 * 1024); /** - * Should be tuned so that task duration is somewhere ~ 10s us. Not too long so it won't affect - * overall app's performance, not too short so it's duration could be measured with enough precision + * Should be tuned so that task duration ~ 10-50 us. Not too long so it won't affect overall app's performance, not too + * short -- so it's duration could be measured with enough precision */ - private static final int MEMORY_OPS_PER_RUN = getIntProperty("JVMResponsivenessMonitor.MEMORY_OPS_PER_RUN", 50); + private static final int MEMORY_OPS_PER_RUN = getIntProperty("JVMResponsivenessMonitor.MEMORY_OPS_PER_RUN", 100); public static final String MONITOR_THREAD_NAME = "JVMResponsivenessMonitor";