|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nuiton.profiling.NuitonTrace
public abstract class NuitonTrace
TODO poussin 20110824 check documentation: this documentation is for aspectwerkz, there are little change for aspectj. see example file aop.xml Permet de tracer les appels aux methodes.
Pour l'utiliser il faut définir un fichier XML qui intercepte les methodes souhaiter.<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE aspectwerkz PUBLIC "-//AspectWerkz//DTD//EN" "http://aspectwerkz.codehaus.org/dtd/aspectwerkz2.dtd"> <aspectwerkz> <system id="sample"> <aspect class="fr.ifremer.isisfish.aspect.TraceIsis"> <pointcut name="executeMethod"> execution(* fr.ifremer.isisfish.datastore.ResultStorage.*(..)) || execution(* fr.ifremer.isisfish.aspect.Cache.*(..)) || execution(* fr.ifremer.isisfish.aspect.Trace.*(..)) || execution(* org.nuiton.topia..*(..)) || execution(* org.nuiton.math.matrix..*(..)) || execution(* fr.ifremer.isisfish.types..*(..)) || execution(* org.apache.commons.collections..*(..)) </pointcut> </aspect> </system> </aspectwerkz>Ensuite il faut lancer la JVM avec deux options
-javaagent:path/to/aspectwerkz-jdk5-2.0.jar -Daspectwerkz.definition.file=path/to/trace-aop.xmlIl est possible d'utiliser des noms normalisé et trouvable dans le classpath a la place de -Daspectwerkz.definition.file
\@Expression( "execution(* fr.ifremer.isisfish.datastore.ResultStorage.*(..))" + "|| execution(* fr.ifremer.isisfish.aspect.Cache.*(..))" + "|| execution(* fr.ifremer.isisfish.aspect.Trace.*(..))" + "|| execution(* org.nuiton.topia..*(..))" + "|| execution(* org.nuiton.math.matrix..*(..))" + "|| execution(* fr.ifremer.isisfish.types..*(..))" + "|| execution(* org.apache.commons.collections..*(..))" ) Pointcut executeMethod;Voir la classe de test
org.nuiton.profiling.NuitonTraceTest.
http://aspectwerkz.codehaus.org/definition_issues.html| Nested Class Summary | |
|---|---|
protected static class |
NuitonTrace.Call
Represente un call de methode |
protected static class |
NuitonTrace.Caller<E>
Classe qui permet d'ajouter un element et compte le nombre de fois que l'on a ajoute cet element. |
protected static class |
NuitonTrace.Statistic
Statistique sur un appele de methode |
| Field Summary | |
|---|---|
protected Map<Method,NuitonTrace.Caller<Method>> |
callers
|
protected static ThreadLocal<Stack<NuitonTrace.Call>> |
callStack
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,NuitonTrace.Statistic> |
statistics
array : [call's numbers, call do, min time, max time, total time, total time with child] |
| Constructor Summary | |
|---|---|
NuitonTrace()
|
|
| Method Summary | |
|---|---|
NuitonTrace.Caller<Method> |
getCallers(Method method)
Retourne la liste des appelant pour la methode passee en parametre |
NuitonTrace.Statistic |
getStatistics(Method method)
Retourne les statistiques d'appele pour la methode passee en parametre |
static String |
getStatisticsAndClear()
|
static String |
getStatisticsCSVAndClear()
|
static void |
printStatisticsAndClear()
|
static void |
printStatisticsAndClear(PrintStream printer)
|
void |
traceAfterExecute(org.aspectj.lang.JoinPoint jp)
|
void |
traceAfterThrowingExecute(org.aspectj.lang.JoinPoint jp)
|
void |
traceBeforeExecute(org.aspectj.lang.JoinPoint jp)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<Method,NuitonTrace.Statistic> statistics
protected Map<Method,NuitonTrace.Caller<Method>> callers
protected static final ThreadLocal<Stack<NuitonTrace.Call>> callStack
| Constructor Detail |
|---|
public NuitonTrace()
| Method Detail |
|---|
public NuitonTrace.Statistic getStatistics(Method method)
method -
public NuitonTrace.Caller<Method> getCallers(Method method)
method -
public void traceBeforeExecute(org.aspectj.lang.JoinPoint jp)
public void traceAfterThrowingExecute(org.aspectj.lang.JoinPoint jp)
public void traceAfterExecute(org.aspectj.lang.JoinPoint jp)
public static String getStatisticsCSVAndClear()
public static String getStatisticsAndClear()
public static void printStatisticsAndClear()
public static void printStatisticsAndClear(PrintStream printer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||