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.Object
Store measures for a given request
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RequestProfiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endMeasures(long measureOutputSize)
End measures of this request.void
endMeasures(java.lang.String id, long curOutputSize)
End measure for given id and add it to the measures of this request.long
getConsumedMemory()
long
getElapsedTime()
java.util.HashMap<java.lang.String,long[]>
getMeasuresMap()
long
getOutputSize()
void
startMeasures()
Start measures of this request.void
startMeasures(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})
-
-