com.jalios.jcms.tools
Class Profiler.RequestProfiler

java.lang.Object
  extended by com.jalios.jcms.tools.Profiler.RequestProfiler
Enclosing class:
Profiler

public class Profiler.RequestProfiler
extends Object

Store measures for a given request


Constructor Summary
protected Profiler.RequestProfiler()
           
 
Method Summary
 void endMeasures(long measureOutputSize)
          End measures of this request.
 void endMeasures(String id, long curOutputSize)
          End measure for given id and add it to the measures of this request.
 long getConsumedMemory()
           
 long getElapsedTime()
           
 HashMap<String,long[]> getMeasuresMap()
           
 long getOutputSize()
           
 void startMeasures()
          Start measures of this request.
 void startMeasures(String id)
          Start a new measure identified with the given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Profiler.RequestProfiler

protected Profiler.RequestProfiler()
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(String id)
Start a new measure identified with the given id.

Parameters:
id - the identification of this measure.

endMeasures

public void endMeasures(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 HashMap<String,long[]> getMeasuresMap()
Returns:
the measures map (id ==> long[] {memory, time})


Copyright © 2001-2010 Jalios SA. All Rights Reserved.