public abstract class NuitonTrace extends Object
<?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| Modifier and Type | Class and Description |
|---|---|
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
|
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
NuitonTrace() |
| Modifier and Type | Method and Description |
|---|---|
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) |
protected Map<Method,NuitonTrace.Statistic> statistics
protected Map<Method,NuitonTrace.Caller<Method>> callers
protected static final ThreadLocal<Stack<NuitonTrace.Call>> callStack
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)
Copyright © 2004-2012 CodeLutin. All Rights Reserved.