public class TimeProfilingListener
extends Object
implements TraceListener
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeProfilingListener.ProfileInstr |
static class |
TimeProfilingListener.ProfileTime |
| Modifier and Type | Field and Description |
|---|---|
private ThreadLocal<LinkedList<TimeProfilingListener.ProfileInstr>> |
stack
Stack of instructions, used to keep track of what XSLT instruction is
being processed.
|
private ThreadLocal<HashMap<TimeProfilingListener.ProfileInstr,TimeProfilingListener.ProfileTime>> |
timeMap
Keeps a count of how many nodes are accessed by each instruction.
|
| Constructor and Description |
|---|
TimeProfilingListener() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addTime(TimeProfilingListener.ProfileInstr instr,
long selfTime)
Add time to a given instruction
|
private void |
clearStack()
Clear the stack, and put the global entry at the top of it.
|
void |
close()
Called when finished processing the stylesheet.
|
void |
endCurrentItem(Item currentItem)
Unused
|
void |
enter(InstructionInfo instruction,
XPathContext context)
Record the instruction being entered, so that subsequent times can
be attributed to it.
|
TimeProfilingListener.ProfileTime[] |
getTimes()
Gets a list of all the times, sorted by ascending time.
|
void |
leave(InstructionInfo instruction)
Called when an instruction is exited.
|
void |
open()
Called when the stylesheet begins execution, but before any instructions.
|
void |
printProfile()
Prints the results of a trace run, to Trace.info().
|
void |
startCurrentItem(Item currentItem)
Unused
|
private ThreadLocal<LinkedList<TimeProfilingListener.ProfileInstr>> stack
private ThreadLocal<HashMap<TimeProfilingListener.ProfileInstr,TimeProfilingListener.ProfileTime>> timeMap
public void open()
open in interface TraceListenerpublic void close()
close in interface TraceListenerprivate void clearStack()
public void enter(InstructionInfo instruction,
XPathContext context)
enter in interface TraceListenerprivate void addTime(TimeProfilingListener.ProfileInstr instr, long selfTime)
public void leave(InstructionInfo instruction)
leave in interface TraceListenerpublic void startCurrentItem(Item currentItem)
startCurrentItem in interface TraceListenerpublic void endCurrentItem(Item currentItem)
endCurrentItem in interface TraceListenerpublic TimeProfilingListener.ProfileTime[] getTimes()
public void printProfile()
throws IOException
IOException