change creation of performance counters
This commit is contained in:
@@ -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