Class ExecutionProfiler
- java.lang.Object
-
- org.eclipse.epsilon.eol.execute.control.ExecutionProfiler
-
- All Implemented Interfaces:
ExecutionController
,IExecutionListener
- Direct Known Subclasses:
RuleProfiler
public class ExecutionProfiler extends java.lang.Object implements ExecutionController, IExecutionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<ModuleElement,java.time.Duration>
executionTimes
-
Constructor Summary
Constructors Constructor Description ExecutionProfiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aboutToExecute(ModuleElement ast, IEolContext context)
void
control(ModuleElement ast, IEolContext context)
void
dispose()
void
done(ModuleElement ast, IEolContext context)
void
finishedExecuting(ModuleElement ast, java.lang.Object result, IEolContext context)
void
finishedExecutingWithException(ModuleElement ast, EolRuntimeException exception, IEolContext context)
java.util.Map<ModuleElement,java.time.Duration>
getExecutionTimes()
boolean
isTerminated()
void
mergeExecutionTimes(java.util.Map<? extends ModuleElement,java.time.Duration>... others)
void
report(IEolContext context)
protected boolean
screenAST(ModuleElement ast, IEolContext context)
Determines whether the ModuleElement should be profiled.java.lang.String
toString()
-
-
-
Field Detail
-
executionTimes
protected final java.util.Map<ModuleElement,java.time.Duration> executionTimes
-
-
Method Detail
-
screenAST
protected boolean screenAST(ModuleElement ast, IEolContext context)
Determines whether the ModuleElement should be profiled.- Parameters:
ast
- The ModuleElement under scrutiny.context
- The context passed tocontrol(ModuleElement, IEolContext)
- Returns:
true
if the ModuleElement should be profiled,false
otherwise.- Since:
- 1.6
-
control
public void control(ModuleElement ast, IEolContext context)
- Specified by:
control
in interfaceExecutionController
-
done
public void done(ModuleElement ast, IEolContext context)
- Specified by:
done
in interfaceExecutionController
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceExecutionController
-
report
public void report(IEolContext context)
- Specified by:
report
in interfaceExecutionController
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
mergeExecutionTimes
@SafeVarargs public final void mergeExecutionTimes(java.util.Map<? extends ModuleElement,java.time.Duration>... others)
-
getExecutionTimes
public java.util.Map<ModuleElement,java.time.Duration> getExecutionTimes()
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceExecutionController
-
aboutToExecute
public void aboutToExecute(ModuleElement ast, IEolContext context)
- Specified by:
aboutToExecute
in interfaceIExecutionListener
-
finishedExecuting
public void finishedExecuting(ModuleElement ast, java.lang.Object result, IEolContext context)
- Specified by:
finishedExecuting
in interfaceIExecutionListener
result
- the result of evaluating ast, calculated during execution
-
finishedExecutingWithException
public void finishedExecutingWithException(ModuleElement ast, EolRuntimeException exception, IEolContext context)
- Specified by:
finishedExecutingWithException
in interfaceIExecutionListener
-
-