public class Trace extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Trace.Call
Represente un call de methode
|
protected static class |
Trace.StatAndStack |
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentLinkedDeque<Trace.StatAndStack> |
allStatAndStack |
protected static ThreadLocal<Trace.StatAndStack> |
callStacks
array : [nest method call, start time, start time with child]
On ne melange pas les stack entre les threads, sinon les resultats
ne veulent plus rien dire car toutes les methodes des threads sont
melangees
|
protected Map<Method,StatisticMethod> |
commonStatistics
statistic on method call
|
protected boolean |
distinctThreadCall |
protected Trace.StatAndStack |
monoStatAndStack |
protected boolean |
multithread |
| Constructor and Description |
|---|
Trace()
default usable in multi-thread context, all calls in all threads
are stored in same place (no thread distinction)
|
Trace(boolean multithread,
boolean distinctThreadCall)
indique que l'on utilise Trace seulement avec un thread, cela evite
d'utiliser en interne un ThreadLocal
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearStatistics()
Clear all statistiques.
|
void |
enter(Method method) |
void |
exit(Method method) |
protected Map<Method,StatisticMethod> |
getCommonStatistics() |
Trace.StatAndStack |
getMonoStatAndStack() |
Trace.StatAndStack |
getStack() |
String |
getStatisticsCSV() |
String |
getStatisticsJson() |
String |
getStatisticsText() |
void |
printStatisticsAndClear() |
void |
printStatisticsAndClear(PrintStream printer) |
protected boolean distinctThreadCall
protected boolean multithread
protected Map<Method,StatisticMethod> commonStatistics
protected Trace.StatAndStack monoStatAndStack
protected ConcurrentLinkedDeque<Trace.StatAndStack> allStatAndStack
protected static final ThreadLocal<Trace.StatAndStack> callStacks
public Trace()
public Trace(boolean multithread,
boolean distinctThreadCall)
multithread - si vrai indique que cette instance est utilise dans un context
multithread. Dans ce cas il est possible d'indique la politique de
collect des appels via le parametre distinctThreadCalldistinctThreadCall - si vrai indique que les appels des differents thread
ne doivent pas etre melange. Si deux thread appel la meme methode
cette methode se trouvera dans des statistiques differentes pour chacun des threadspublic Trace.StatAndStack getMonoStatAndStack()
protected Map<Method,StatisticMethod> getCommonStatistics()
public Trace.StatAndStack getStack()
public void enter(Method method)
public void exit(Method method)
public String getStatisticsCSV()
public String getStatisticsJson()
public void clearStatistics()
public String getStatisticsText()
public void printStatisticsAndClear()
public void printStatisticsAndClear(PrintStream printer)
Copyright © 2004–2014 CodeLutin. All rights reserved.