org.eclipse.xtend.profiler
Class Profiler

java.lang.Object
  extended by org.eclipse.xtend.profiler.Profiler

public class Profiler
extends java.lang.Object

Records method calls and the resulting call stack to build up a profiling result. Please understand that the given implementation is not aware of threads but uses a simple idea of a linearity. Also, the implementation uses a TimeProvider that per default relies on the system time. This might lead into problems when hibernating the execution environment or debugging the runtime system. The output is will not be scanned for cycles. Use a CycleDetector as a post-processing step for this

Author:
Heiko Behrens - Initial contribution and API TODO: Make this class acting as a facade that can handle cycles by itself and offers result only after the internal state has been fixed to prevent further modifications.
See Also:
CycleDetector

Nested Class Summary
static interface Profiler.TimeProvider
           
 
Constructor Summary
Profiler()
           
Profiler(ProfilingResult profilingResult)
           
 
Method Summary
 void beginRoutine(java.lang.String key)
           
 void endRoutine()
           
 Item getItem(java.lang.String key)
           
 ProfilingResult getProfilingResult()
           
 Profiler.TimeProvider getTimeProvider()
           
 boolean hasFinished()
           
 void setTimeProvider(Profiler.TimeProvider timeProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Profiler

public Profiler()

Profiler

public Profiler(ProfilingResult profilingResult)
Method Detail

getTimeProvider

public Profiler.TimeProvider getTimeProvider()

setTimeProvider

public void setTimeProvider(Profiler.TimeProvider timeProvider)

getProfilingResult

public ProfilingResult getProfilingResult()

getItem

public Item getItem(java.lang.String key)

beginRoutine

public void beginRoutine(java.lang.String key)

endRoutine

public void endRoutine()

hasFinished

public boolean hasFinished()