Package com.jalios.jcms.tools
Class Profiler.RequestProfiler
- java.lang.Object
-
- com.jalios.jcms.tools.Profiler.RequestProfiler
-
- Enclosing class:
- Profiler
public class Profiler.RequestProfiler extends java.lang.ObjectStore measures for a given request
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRequestProfiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendMeasures(long measureOutputSize)End measures of this request.voidendMeasures(java.lang.String id, long curOutputSize)End measure for given id and add it to the measures of this request.longgetConsumedMemory()longgetElapsedTime()java.util.HashMap<java.lang.String,long[]>getMeasuresMap()longgetOutputSize()voidstartMeasures()Start measures of this request.voidstartMeasures(java.lang.String id)Start a new measure identified with the given id.
-
-
-
Method Detail
-
startMeasures
public void startMeasures()
Start measures of this request. Call this method as soon as possible when processing a request. WARNING: This method does a Util.forceFullGarbageCollection(2000).
-
startMeasures
public void startMeasures(java.lang.String id)
Start a new measure identified with the given id.- Parameters:
id- the identification of this measure.
-
endMeasures
public void endMeasures(java.lang.String id, long curOutputSize)End measure for given id and add it to the measures of this request.- Parameters:
id- the identification of this measure.curOutputSize- the size of the content that was outputted for this measure
-
endMeasures
public void endMeasures(long measureOutputSize)
End measures of this request. Call this method at the end of all processing done by a request.- Parameters:
measureOutputSize- the size of the content that was outputted for this request
-
getConsumedMemory
public long getConsumedMemory()
- Returns:
- the total memory used between call to startMeasures() and endMeasures()
-
getElapsedTime
public long getElapsedTime()
- Returns:
- the total time elapsed between call to startMeasures() and endMeasures()
-
getOutputSize
public long getOutputSize()
- Returns:
- the total output size between call to startMeasures() and endMeasures()
-
getMeasuresMap
public java.util.HashMap<java.lang.String,long[]> getMeasuresMap()
- Returns:
- the measures map (id ==> long[] {memory, time})
-
-