com.sun.faban.harness.common
Class BenchmarkDescription

java.lang.Object
  extended by com.sun.faban.harness.common.BenchmarkDescription
All Implemented Interfaces:
Serializable

public class BenchmarkDescription
extends Object
implements Serializable

This is a value class describing the benchmark.

Author:
Akara Sucharitakul
See Also:
Serialized Form

Field Summary
 String bannerPage
          Banner page for the benchmark.
 String benchmarkClass
          The benchmark class name.
 String configFileName
          The file used for configuring the benchmark.
 String configForm
          The form used to configure the benchmark.
 String configStylesheet
          The stylesheet used to format the form, if any.
static int MAP_TIMEOUT
          The max time to cache a map, 10 secs.
 String metric
          The benchmark metric.
 String name
          The full name of the benchmark.
 String resultFilePath
          The result file path relative to the output directory.
 String scaleName
          The name of the benchmark scale.
 String scaleUnit
          The name of the benchmark unit.
 String shortName
          The short name of the benchmark, and also the directory names.
 String version
          The version of the benchmark.
 
Method Summary
static String getBannerName()
          Returns the name to display on the banner.
static String getBannerPage()
          Returns the banner page supplied by the user.
static String getBannerVersion()
          Returns the version number to display on the banner.
static Map<String,BenchmarkDescription> getBenchDirMap()
          Obtains a map of benchmarks using the directory (or short name) as the key.
static Map<String,BenchmarkDescription> getBenchDirMap(boolean deploy)
          Obtains a map of benchmarks using the directory (or short name) as the key.
static HashMap<String,BenchmarkDescription> getBenchNameMap()
          Obtains a map of benchmarks using the full name as the key.
static BenchmarkDescription getDescription(String dir)
          Obtains the benchmark description for a certain deploy directory or short name.
static BenchmarkDescription getDescription(String shortName, String dir)
          Obtains the benchmark description from a directory, not from cache.
static BenchmarkDescription readDescription(String shortName, String dir)
          Reads the benchmark description from a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_TIMEOUT

public static final int MAP_TIMEOUT
The max time to cache a map, 10 secs.

See Also:
Constant Field Values

bannerPage

public String bannerPage
Banner page for the benchmark.


shortName

public String shortName
The short name of the benchmark, and also the directory names.


name

public String name
The full name of the benchmark. This name may contain spaces.


version

public String version
The version of the benchmark.


configForm

public String configForm
The form used to configure the benchmark.


configStylesheet

public String configStylesheet
The stylesheet used to format the form, if any.


configFileName

public String configFileName
The file used for configuring the benchmark.


resultFilePath

public String resultFilePath
The result file path relative to the output directory.


benchmarkClass

public String benchmarkClass
The benchmark class name.


metric

public String metric
The benchmark metric.


scaleName

public String scaleName
The name of the benchmark scale.


scaleUnit

public String scaleUnit
The name of the benchmark unit.

Method Detail

getBenchDirMap

public static Map<String,BenchmarkDescription> getBenchDirMap()
Obtains a map of benchmarks using the directory (or short name) as the key.

Returns:
The directory map of currently deployed benchmarks

getBenchDirMap

public static Map<String,BenchmarkDescription> getBenchDirMap(boolean deploy)
Obtains a map of benchmarks using the directory (or short name) as the key.

Parameters:
deploy - of type boolean
Returns:
The resulting map

getBenchNameMap

public static HashMap<String,BenchmarkDescription> getBenchNameMap()
Obtains a map of benchmarks using the full name as the key.

Returns:
The name map of currently deployed benchmarks

getDescription

public static BenchmarkDescription getDescription(String dir)
Obtains the benchmark description for a certain deploy directory or short name.

Parameters:
dir - The deploy directory or short name of the benchmark
Returns:
The benchmark description or null of none exists

getBannerPage

public static String getBannerPage()
Returns the banner page supplied by the user.

Returns:
banner page

getBannerName

public static String getBannerName()
Returns the name to display on the banner. If only one benchmark is deployed, the benchmark name and version will be used for the banner. Otherwise the name "Faban" and the faban version will be used for the banner.

Returns:
The name to display on the banner page

getBannerVersion

public static String getBannerVersion()
Returns the version number to display on the banner. If only one benchmark is deployed, the benchmark name and version will be used for the banner. Otherwise the name "Faban" and the faban version will be used for the banner.

Returns:
The version to display on the banner

getDescription

public static BenchmarkDescription getDescription(String shortName,
                                                  String dir)
Obtains the benchmark description from a directory, not from cache. The directory can either be the benchmark deployment directory or the benchmark result dir. The benchmark directory is given as an absolute path.

Parameters:
shortName - The short benchmark name, equals the deployment directory
dir - The benchmark directory
Returns:
The benchmark description object, or null if there are errors

readDescription

public static BenchmarkDescription readDescription(String shortName,
                                                   String dir)
                                            throws Exception
Reads the benchmark description from a directory. This can be either the benchmark deployment directory or the benchmark result dir. The benchmark directory is given as an absolute path.

Parameters:
shortName - The short benchmark name, equals the deployment directory
dir - The benchmark directory
Returns:
The benchmark description object
Throws:
Exception - error reading or processing the description