|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTimeProfilingListener
public class TimeProfilingListener
Used to keep track of the current instruction being executed, and to keep track of time spent in each one.
Nested Class Summary | |
---|---|
static class |
TimeProfilingListener.ProfileInstr
|
static class |
TimeProfilingListener.ProfileTime
|
Field Summary | |
---|---|
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 Summary | |
---|---|
TimeProfilingListener()
|
Method Summary | |
---|---|
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 |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ThreadLocal<LinkedList<TimeProfilingListener.ProfileInstr>> stack
private ThreadLocal<HashMap<TimeProfilingListener.ProfileInstr,TimeProfilingListener.ProfileTime>> timeMap
Constructor Detail |
---|
public TimeProfilingListener()
Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |