change creation of performance counters
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ import kotlin.properties.Delegates
|
||||
public class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager)
|
||||
: CoreJavaFileManager(myPsiManager), KotlinCliJavaFileManager {
|
||||
|
||||
private val perfCounter = PerformanceCounter("Find Java class")
|
||||
private val perfCounter = PerformanceCounter.create("Find Java class")
|
||||
private var index: JvmDependenciesIndex by Delegates.notNull()
|
||||
|
||||
public fun initIndex(packagesCache: JvmDependenciesIndex) {
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class VirtualFileKotlinClass private constructor(
|
||||
|
||||
companion object Factory {
|
||||
private val LOG = Logger.getInstance(javaClass<VirtualFileKotlinClass>())
|
||||
private val perfCounter = PerformanceCounter("Binary class from Kotlin file")
|
||||
private val perfCounter = PerformanceCounter.create("Binary class from Kotlin file")
|
||||
|
||||
deprecated("Use KotlinBinaryClassCache")
|
||||
fun create(file: VirtualFile): VirtualFileKotlinClass? {
|
||||
|
||||
@@ -74,8 +74,8 @@ public class CallResolver {
|
||||
private TaskPrioritizer taskPrioritizer;
|
||||
private AdditionalCheckerProvider additionalCheckerProvider;
|
||||
|
||||
private static final PerformanceCounter callResolvePerfCounter = new PerformanceCounter("Call resolve", true);
|
||||
private static final PerformanceCounter candidatePerfCounter = new PerformanceCounter("Call resolve candidate analysis", true);
|
||||
private static final PerformanceCounter callResolvePerfCounter = PerformanceCounter.Companion.create("Call resolve", true);
|
||||
private static final PerformanceCounter candidatePerfCounter = PerformanceCounter.Companion.create("Call resolve candidate analysis", true);
|
||||
|
||||
@Inject
|
||||
public void setExpressionTypingServices(@NotNull ExpressionTypingServices expressionTypingServices) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.util
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
public class PerformanceCounter jvmOverloads constructor (val name: String, val reenterable: Boolean = false) {
|
||||
public class PerformanceCounter private constructor (val name: String, val reenterable: Boolean = false) {
|
||||
companion object {
|
||||
private val threadMxBean = ManagementFactory.getThreadMXBean()
|
||||
private val allCounters = arrayListOf<PerformanceCounter>()
|
||||
@@ -58,6 +58,10 @@ public class PerformanceCounter jvmOverloads constructor (val name: String, val
|
||||
public fun setTimeCounterEnabled(enable: Boolean) {
|
||||
enabled = enable
|
||||
}
|
||||
|
||||
public jvmOverloads fun create(name: String, reentable: Boolean = false): PerformanceCounter {
|
||||
return PerformanceCounter(name, reentable)
|
||||
}
|
||||
}
|
||||
|
||||
private var count: Int = 0
|
||||
|
||||
Reference in New Issue
Block a user