|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectLazyProfilingListener
public class LazyProfilingListener
Used to keep track of the current instruction being executed, and to keep track of counts for each one.
| Nested Class Summary | |
|---|---|
static class |
LazyProfilingListener.ProfileCount
Simple data structure to keep track of counts. |
| Field Summary | |
|---|---|
private static LazyProfilingListener.ProfileCount |
emptyInstr
Dummy used for counting nodes when no instruction is specified |
private ThreadLocal |
tlCountMap
Keeps a count of how many nodes are accessed by each instruction. |
private ThreadLocal |
tlInstructionStack
Stack of instructions, used to keep track of what XSLT instruction is being processed. |
| Constructor Summary | |
|---|---|
LazyProfilingListener()
|
|
| Method Summary | |
|---|---|
void |
bumpCount(int nodeNum)
Increases the count by one for the current instruction. |
void |
close()
Unused |
void |
endCurrentItem(Item currentItem)
Unused |
void |
enter(InstructionInfo instruction,
XPathContext context)
Record the instruction being entered, so that subsequent counts can be attributed to it. |
private HashMap |
getCountMap()
Get a thread-local count map |
LazyProfilingListener.ProfileCount[] |
getCounts()
Gets a list of all the counts, sorted by ascending count. |
private LinkedList |
getInstructionStack()
Get a thread-local instruction stack |
void |
leave(InstructionInfo instruction)
Called when an instruction is exited. |
void |
open()
Unused |
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 tlInstructionStack
private static final LazyProfilingListener.ProfileCount emptyInstr
private ThreadLocal tlCountMap
| Constructor Detail |
|---|
public LazyProfilingListener()
| Method Detail |
|---|
public void open()
open in interface TraceListenerpublic void close()
close in interface TraceListenerprivate LinkedList getInstructionStack()
private HashMap getCountMap()
public void enter(InstructionInfo instruction,
XPathContext context)
enter in interface TraceListenerpublic void leave(InstructionInfo instruction)
leave in interface TraceListenerpublic void startCurrentItem(Item currentItem)
startCurrentItem in interface TraceListenerpublic void endCurrentItem(Item currentItem)
endCurrentItem in interface TraceListenerpublic void bumpCount(int nodeNum)
public LazyProfilingListener.ProfileCount[] getCounts()
public void printProfile()
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||