Class Profiler.RequestProfiler

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

public class Profiler.RequestProfiler extends Object
Store measures for a given request
  • 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

      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})