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 TraceListener
public void close()
close
in interface TraceListener
private void clearStack()
public void enter(InstructionInfo instruction, XPathContext context)
enter
in interface TraceListener
private void addTime(TimeProfilingListener.ProfileInstr instr, long selfTime)
public void leave(InstructionInfo instruction)
leave
in interface TraceListener
public void startCurrentItem(Item currentItem)
startCurrentItem
in interface TraceListener
public void endCurrentItem(Item currentItem)
endCurrentItem
in interface TraceListener
public TimeProfilingListener.ProfileTime[] getTimes()
public void printProfile() throws IOException
IOException