Revert accidentally committed change
TMP Reuse Profiler instance to collect statistics This reverts commit 56267a68955fd94ba36f79ce526fd198a8c630a2.
This commit is contained in:
parent
73f86ba626
commit
f30a560073
|
|
@ -171,23 +171,19 @@ internal class EvaluationSessionImpl private constructor (
|
|||
@Suppress("UNCHECKED_CAST")
|
||||
val durations = parameters[ParameterKey.of("profiling.data", MutableMap::class.java)]
|
||||
as MutableMap<String, String>?
|
||||
val profiler = durations?.let { (token as? SessionTokenImpl)?.profiler ?: Profiler() }
|
||||
val profiler = durations?.let { Profiler() }
|
||||
|
||||
session = EvaluationSessionImpl(ispec, program, supervisor, evaluationTrace, profiler, parameters)
|
||||
Backend.ourBackend.ourSession.set(session)
|
||||
try {
|
||||
val main = parameters[ParameterKey.of("main", Constraint::class.java)] as Constraint
|
||||
val result = session.launch(token, main)
|
||||
if (profiler != null) {
|
||||
((result as EvaluationResultImpl).token as SessionTokenImpl).profiler = profiler
|
||||
}
|
||||
return result
|
||||
return session.launch(token, main)
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
profiler?.run {
|
||||
formattedData().entries.forEach { e -> durations.put(e.key, e.value) }
|
||||
// clear()
|
||||
clear()
|
||||
}
|
||||
}
|
||||
catch (t: Throwable) {
|
||||
|
|
@ -195,6 +191,7 @@ internal class EvaluationSessionImpl private constructor (
|
|||
}
|
||||
Backend.ourBackend.ourSession.set(null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import jetbrains.mps.logic.reactor.core.RuleIndex
|
|||
import jetbrains.mps.logic.reactor.evaluation.MatchJournalView
|
||||
import jetbrains.mps.logic.reactor.evaluation.SessionToken
|
||||
import jetbrains.mps.logic.reactor.program.Rule
|
||||
import jetbrains.mps.logic.reactor.util.Profiler
|
||||
|
||||
data class SessionTokenImpl(
|
||||
private val journalView: MatchJournal.View,
|
||||
|
|
@ -30,8 +29,7 @@ data class SessionTokenImpl(
|
|||
private val frontState: DispatchingFrontState,
|
||||
val ruleIndex: RuleIndex,
|
||||
val logicalState: LogicalState,
|
||||
val principalObservers: PrincipalObserverDispatcher = PrincipalObserverDispatcher.EMPTY,
|
||||
var profiler: Profiler? = null
|
||||
val principalObservers: PrincipalObserverDispatcher = PrincipalObserverDispatcher.EMPTY
|
||||
) : SessionToken
|
||||
{
|
||||
override fun getJournalView(): MatchJournalView = journalView
|
||||
|
|
|
|||
Loading…
Reference in New Issue