|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.tools.Profiler
public class Profiler
Allow one to profile performance in JCMS.
While admin:
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();
Nested Class Summary | |
---|---|
class |
Profiler.RequestProfiler
Store measures for a given request |
Method Summary | |
---|---|
protected void |
addMeasuredId(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 Collection<Profiler> |
getAllProfilers()
|
long |
getAverageConsumedMemory()
|
long |
getAverageElapsedTime()
|
HashMap<String,long[]> |
getAverageMeasuresMap()
|
long |
getAverageOutputSize()
|
Date |
getEndDate()
|
String |
getName()
|
long |
getProfiledRequestNumber()
|
static Profiler |
getProfiler(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. |
TreeMap<String,long[]> |
getSortedAverageMeasuresMap()
|
Date |
getStartDate()
|
boolean |
isProfiling()
|
static void |
removeAllProfiler()
Remove all profilers currently availables. |
static void |
removeProfiler(String name)
Remove the profiler named "name". |
void |
startProfiling()
Start profiling (clean older result if existing) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Profiler getProfiler(String name, boolean create)
name
, or null if it does not exist
name
- 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 Collection<Profiler> getAllProfilers()
public static void removeProfiler(String name)
name
- the name of the profiler to removepublic static void removeAllProfiler()
public String getName()
public void startProfiling()
public void endProfiling()
public boolean isProfiling()
protected void addMeasuredId(String id)
protected void computeAverage()
public Profiler.RequestProfiler getRequestProfiler(javax.servlet.http.HttpServletRequest request)
request
- the request of which to find RequestProfiler
public long getAverageConsumedMemory()
public long getAverageElapsedTime()
public long getAverageOutputSize()
public HashMap<String,long[]> getAverageMeasuresMap()
public long getProfiledRequestNumber()
public Date getStartDate()
public Date getEndDate()
public TreeMap<String,long[]> getSortedAverageMeasuresMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |