org.eclipse.test.internal.performance.results
Class PerformanceResults

java.lang.Object
  extended by org.eclipse.test.internal.performance.results.AbstractResults
      extended by org.eclipse.test.internal.performance.results.PerformanceResults
All Implemented Interfaces:
java.lang.Comparable

public class PerformanceResults
extends AbstractResults

Root class to handle performance results. Usually performance results are built for a current build vs. a baseline build. This class allow to read all data from releng performance database for given configurations and scenario pattern. Then it provides easy and speedy access to all stored results.


Field Summary
static int DEFAULT_FAILURE_THRESHOLD
           
 
Fields inherited from class org.eclipse.test.internal.performance.results.AbstractResults
BOXES, CONFIGS, DEFAULT_DIM, SUPPORTED_DIMS, VERSION, VERSION_REF
 
Constructor Summary
PerformanceResults(java.lang.String name, java.lang.String baseline, java.lang.String baselinePrefix, java.io.PrintStream stream)
           
 
Method Summary
 java.lang.String[] getAllBuildNames()
          Returns the list of all builds currently read.
 java.lang.String getBaselineName()
          Returns the name of the baseline used for extracted results
 java.lang.String getBuildDate()
           
 java.lang.String[] getComponents()
          Return the list of components concerned by performance results.
 java.util.List getComponentScenarios(java.lang.String componentName)
          Get the scenarios of a given component.
 java.util.List getComponentSummaryScenarios(java.lang.String componentName, java.lang.String config)
          Get the scenarios which have a summary for a given component.
 java.lang.String[] getConfigBoxes(boolean sort)
          Return the configuration boxes considered for this performance results sorted or not depending on the given flag.
 java.lang.String[] getConfigNames(boolean sort)
          Return the configuration names considered for this performance results sorted or not depending on the given flag.
 java.lang.String getLastBuildName()
          Return the name of the last build name except baselines.
 java.lang.String getLastBuildName(int kind)
          Return the name of the last build name
 java.lang.String getName()
          Returns the name of the results object.
 ScenarioResults getScenarioResults(java.lang.String scenarioName)
          Get the results of a given scenario.
 java.lang.String[] readAll(java.lang.String buildName, java.lang.String[][] configs, java.lang.String pattern, java.io.File dataDir, int threshold, org.eclipse.core.runtime.IProgressMonitor monitor)
          Read all data from performance database for the given configurations and scenario pattern.
 java.lang.String[] readLocal(java.io.File dataDir, org.eclipse.core.runtime.IProgressMonitor monitor)
          Read all data from performance database for the given configurations and scenario pattern.
 java.lang.String[] updateBuild(java.lang.String buildName, boolean force, java.io.File dataDir, org.eclipse.core.runtime.IProgressMonitor monitor)
          Update a given build information with database contents.
 java.lang.String[] updateBuilds(java.lang.String[] builds, boolean force, java.io.File dataDir, org.eclipse.core.runtime.IProgressMonitor monitor)
          Update a given build information with database contents.
 
Methods inherited from class org.eclipse.test.internal.performance.results.AbstractResults
compareTo, copyFile, equals, getBuildDate, getBuildDate, getChildren, getParent, getResults, hashCode, size, timeChrono, timeEnd, timeString, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_FAILURE_THRESHOLD

public static final int DEFAULT_FAILURE_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

PerformanceResults

public PerformanceResults(java.lang.String name,
                          java.lang.String baseline,
                          java.lang.String baselinePrefix,
                          java.io.PrintStream stream)
Method Detail

getAllBuildNames

public java.lang.String[] getAllBuildNames()
Returns the list of all builds currently read.

Returns:
The names list of all currently known builds

getBaselineName

public java.lang.String getBaselineName()
Returns the name of the baseline used for extracted results

Returns:
The build name of the baseline of null if no specific baseline is used for the extracted results.

getBuildDate

public java.lang.String getBuildDate()

getComponents

public java.lang.String[] getComponents()
Return the list of components concerned by performance results.

Returns:
The list of the components

getComponentScenarios

public java.util.List getComponentScenarios(java.lang.String componentName)
Get the scenarios of a given component.

Parameters:
componentName - The component name. Should not be null
Returns:
A list of scenario results

getComponentSummaryScenarios

public java.util.List getComponentSummaryScenarios(java.lang.String componentName,
                                                   java.lang.String config)
Get the scenarios which have a summary for a given component.

Parameters:
componentName - The component name
config - Configuration name
Returns:
A list of scenario results which have a summary

getConfigBoxes

public java.lang.String[] getConfigBoxes(boolean sort)
Return the configuration boxes considered for this performance results sorted or not depending on the given flag.

Parameters:
sort - Indicates whether the list must be sorted or not. The order is defined by the configuration names, not by the box names
Returns:
The list of configuration boxes sorted by configuration names

getConfigNames

public java.lang.String[] getConfigNames(boolean sort)
Return the configuration names considered for this performance results sorted or not depending on the given flag.

Parameters:
sort - Indicates whether the list must be sorted or not
Returns:
The list of configuration names

getLastBuildName

public java.lang.String getLastBuildName()
Return the name of the last build name except baselines.

Returns:
the name of the last build

getLastBuildName

public java.lang.String getLastBuildName(int kind)
Return the name of the last build name

Parameters:
kind - Decide what kind of build is taken into account 0: all kind of build 1: all except baseline builds 2: all except baseline and nightly builds 3: only integration builds
Returns:
the name of the last build of the selected kind

getName

public java.lang.String getName()
Description copied from class: AbstractResults
Returns the name of the results object.

Overrides:
getName in class AbstractResults
Returns:
The name of the results

getScenarioResults

public ScenarioResults getScenarioResults(java.lang.String scenarioName)
Get the results of a given scenario.

Parameters:
scenarioName - The scenario name
Returns:
The scenario results

readAll

public java.lang.String[] readAll(java.lang.String buildName,
                                  java.lang.String[][] configs,
                                  java.lang.String pattern,
                                  java.io.File dataDir,
                                  int threshold,
                                  org.eclipse.core.runtime.IProgressMonitor monitor)
Read all data from performance database for the given configurations and scenario pattern.

Parameters:
buildName - The name of the build
configs - All configurations to extract results. If null, then all known configurations (AbstractResults.CONFIGS) are read.
pattern - The pattern of the concerned scenarios
dataDir - The directory where data will be read/stored locally. If null, then database will be read instead and no storage will be performed
threshold - The failure percentage threshold over which a build result value compared to the baseline is considered as failing.
monitor - The progress monitor
Returns:
All known builds

readLocal

public java.lang.String[] readLocal(java.io.File dataDir,
                                    org.eclipse.core.runtime.IProgressMonitor monitor)
Read all data from performance database for the given configurations and scenario pattern. Note that calling this method flush all previous read data.

Parameters:
dataDir - The directory where local files are located
monitor - The progress monitor
Returns:
The list of build names read in local files

updateBuilds

public java.lang.String[] updateBuilds(java.lang.String[] builds,
                                       boolean force,
                                       java.io.File dataDir,
                                       org.eclipse.core.runtime.IProgressMonitor monitor)
Update a given build information with database contents.

Parameters:
builds - The builds to read new data
force - Force the update from the database, even if the build is already known.
dataDir - The directory where data should be stored locally if necessary. If null, then information changes won't be persisted.
monitor - The progress monitor
Returns:
All known builds

updateBuild

public java.lang.String[] updateBuild(java.lang.String buildName,
                                      boolean force,
                                      java.io.File dataDir,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
Update a given build information with database contents.

Parameters:
buildName - The build name to read new data
force - Force the update from the database, even if the build is already known.
dataDir - The directory where data should be stored locally if necessary. If null, then information changes won't be persisted.
monitor - The progress monitor
Returns:
All known builds