public class Profiler
extends java.lang.Object
Profiler profiler = Profiler.getProfiler("test1", true);
profiler.startProfiling();
Profiler profiler = Profiler.getProfiler("test1", false);
Profiler.RequestProfiler rprofiler = profiler.getRequestProfiler(request);
rprofiler.startMeasures();
rprofiler.startMeasures("something"); doSomething(...); rprofiler.endMeasures("something");
rprofile.endMeasures();
profiler.endProfiling();
Modifier and Type | Class and Description |
---|---|
class |
Profiler.RequestProfiler
Store measures for a given request
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMeasuredId(java.lang.String id)
Method called by request profiler to add measured id;
|
protected void |
computeAverage() |
void |
endProfiling()
End profiling and compute average of RequestProfiler measures.
|
static java.util.Collection<Profiler> |
getAllProfilers() |
long |
getAverageConsumedMemory() |
long |
getAverageElapsedTime() |
java.util.HashMap<java.lang.String,long[]> |
getAverageMeasuresMap() |
long |
getAverageOutputSize() |
java.util.Date |
getEndDate() |
java.lang.String |
getName() |
long |
getProfiledRequestNumber() |
static Profiler |
getProfiler(java.lang.String name,
boolean create)
Return an existing Profiler with the name
name , or null if it does not exist |
Profiler.RequestProfiler |
getRequestProfiler(javax.servlet.http.HttpServletRequest request)
Return the request profiler associated with the given request and create a new one if
none is available.
|
java.util.TreeMap<java.lang.String,long[]> |
getSortedAverageMeasuresMap() |
java.util.Date |
getStartDate() |
boolean |
isProfiling() |
static void |
removeAllProfiler()
Remove all profilers currently availables.
|
static void |
removeProfiler(java.lang.String name)
Remove the profiler named "name".
|
void |
startProfiling()
Start profiling (clean older result if existing)
|
public static Profiler getProfiler(java.lang.String name, boolean create)
name
, or null if it does not existname
- the name of the profiler to retrievecreate
- if true, will create the profiler if it does not exist (be sure to create only when admin)public static java.util.Collection<Profiler> getAllProfilers()
public static void removeProfiler(java.lang.String name)
name
- the name of the profiler to removepublic static void removeAllProfiler()
public java.lang.String getName()
public void startProfiling()
public void endProfiling()
public boolean isProfiling()
protected void addMeasuredId(java.lang.String id)
protected void computeAverage()
public Profiler.RequestProfiler getRequestProfiler(javax.servlet.http.HttpServletRequest request)
request
- the request of which to find RequestProfilerpublic long getAverageConsumedMemory()
public long getAverageElapsedTime()
public long getAverageOutputSize()
public java.util.HashMap<java.lang.String,long[]> getAverageMeasuresMap()
public long getProfiledRequestNumber()
public java.util.Date getStartDate()
public java.util.Date getEndDate()
public java.util.TreeMap<java.lang.String,long[]> getSortedAverageMeasuresMap()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.