Package com.jalios.jcms.tools
Class Profiler.RequestProfiler
java.lang.Object
com.jalios.jcms.tools.Profiler.RequestProfiler
- Enclosing class:
Profiler
Store measures for a given request
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendMeasures(long measureOutputSize) End measures of this request.voidendMeasures(String id, long curOutputSize) End measure for given id and add it to the measures of this request.longlonglongvoidStart measures of this request.voidstartMeasures(String id) Start a new measure identified with the given id.
-
Constructor Details
-
RequestProfiler
protected RequestProfiler()
-
-
Method Details
-
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
Start a new measure identified with the given id.- Parameters:
id- the identification of this measure.
-
endMeasures
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
- Returns:
- the measures map (id ==> long[] {memory, time})
-