org.apache.cocoon.components.profiler
Class ProfilerData

java.lang.Object
  extended by org.apache.cocoon.components.profiler.ProfilerData

public class ProfilerData
extends Object

Request-time profiler information.

Version:
CVS $Id: ProfilerData.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Vadim Gritsenko, Bruno Dumon, Stephan Michels

Nested Class Summary
static class ProfilerData.Entry
          Entry, which stores the role and source of a component from a pipeline.
 
Constructor Summary
ProfilerData()
          Create a new profiler dataset.
 
Method Summary
 void addComponent(Object component, String role, String source)
          Add new component from the pipeling, which should be measured.
 int getCount()
          Returns the count of components.
 ProfilerData.Entry[] getEntries()
          Returns all measured times.
 EnvironmentInfo getEnvironmentInfo()
          Returns the environment information.
 long getKey(String uri)
          Generate a key for a given URI for this pipeline
 long getProcessingTime(int index)
          Get measured processing time of the i-th component of the pipeline.
 long getSetupTime(int index)
          Get measured setup time of the i-th component of the pipeline.
 long getTotalTime()
          Return measured time of precessing from the pipeline.
 void setEnvironmentInfo(EnvironmentInfo environmentinfo)
          Set the environment information.
 void setProcessingTime(int index, long time)
          Set measured processing time of the i-th component of the pipeline.
 void setSAXFragment(int index, Object fragment)
          Set the SAX fragment for the i-th component of the pipeline.
 void setSetupTime(int index, long time)
          Set measured setup time of the i-th component of the pipeline.
 void setTotalTime(long time)
          Set measured time of precessing from the pipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfilerData

public ProfilerData()
Create a new profiler dataset.

Method Detail

addComponent

public void addComponent(Object component,
                         String role,
                         String source)
Add new component from the pipeling, which should be measured.

Parameters:
component - Component of the pipeline.
role - Role of the component.
source - Source attribute of the component.

getCount

public int getCount()
Returns the count of components.

Returns:
Count of components.

setEnvironmentInfo

public void setEnvironmentInfo(EnvironmentInfo environmentinfo)
Set the environment information.

Parameters:
environmentinfo - Environment information.

getEnvironmentInfo

public EnvironmentInfo getEnvironmentInfo()
Returns the environment information.

Returns:
Environment information.

setTotalTime

public void setTotalTime(long time)
Set measured time of precessing from the pipeline.

Parameters:
time - Total time of all components.

getTotalTime

public long getTotalTime()
Return measured time of precessing from the pipeline.

Returns:
Total time of all components.

setSetupTime

public void setSetupTime(int index,
                         long time)
Set measured setup time of the i-th component of the pipeline.

Parameters:
index - Index of the component.
time - Measured setup time of the component.

getSetupTime

public long getSetupTime(int index)
Get measured setup time of the i-th component of the pipeline.

Parameters:
index - Index of the component.
Returns:
Measured setup time of the component.

setProcessingTime

public void setProcessingTime(int index,
                              long time)
Set measured processing time of the i-th component of the pipeline.

Parameters:
index - Index of the component.
time - Measured processing time of the component.

getProcessingTime

public long getProcessingTime(int index)
Get measured processing time of the i-th component of the pipeline.

Parameters:
index - Index of the component.
Returns:
Measured processing time of the component.

setSAXFragment

public void setSAXFragment(int index,
                           Object fragment)
Set the SAX fragment for the i-th component of the pipeline.

Parameters:
index - Index of the component.
fragment - SAX fragment of the component.

getEntries

public ProfilerData.Entry[] getEntries()
Returns all measured times.

Returns:
Array of all entries.

getKey

public long getKey(String uri)
Generate a key for a given URI for this pipeline

Parameters:
uri - URI
Returns:
Hash key.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.