All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class spec.harness.Context

spec.harness.Context

public final class Context
This class is used to define the context for the execution of the benchmark. This container class has the parameters which can hold the benchmark run specific parameters like the run time, speed, files opened, number of cached_files, SpecBasePath, console window for displaying the trace


Variable Index

 o out
out is the PrintStream into which the trace messages will be written.

Constructor Index

 o Context()

Method Index

 o addCachedDataSize(int)
Increments the the cached_data parameter by the integer passed.
 o addIOtime(long)
Increments the IOTime by the value provided
 o appendWindow(String)
Output to console window
 o cdInput()
This function changes the basepath to point to the input directory of the benchmark.
 o clearIOtime()
Clears the IOtiming.
 o DecrementNumOpenFiles()
Decrements the number of Files open parameter
 o getBasePath()
Returns the spec base path.
 o getCachedDataSize()
gets the cached data size.
 o getCommandLineMode()
Get commandLineMode flag
 o getGraphicsMode()
Returns the graphic mode flag value
 o getIOtime()
Returns the IO time
 o getNumCachedFiles()
gets the numbef of cached files.
 o getNumOpenFiles()
returns the number of files open
 o getSpecBasePath()
returns the specbase path
 o getSpeed()
Returns the speed of the benchmark.
 o getUserPropFile()
Returns the properties file name
 o getValue(String, int)
This function returns the integer value given the String form of it.
 o getVerify()
Get verify flag
 o IncrementNumCachedFiles()
Increments the the num_cached_files parameter by 1.
 o IncrementNumOpenFiles()
Increments the number of Files open parameter.
 o isBatch()
Returns whether SpecJVMClient is running in batch mode
 o isCachedInput()
Returns the cached input flag
 o isNetworkAccess()
Indicates whether SpecJVMClient is running as an applet or application
 o setBatch(boolean)
Sets the batch flag
 o setBenchmarkRelPath(String)
sets the benchmark relative path.
 o setCachedInputFlag(boolean)
Sets the CachedInput flag.
 o setCommandLineMode(boolean)
Set commandLineMode flag
 o setGraphicsMode(boolean)
Sets the graphics mode.
 o setNetworkAccess(boolean)
Sets the network access flag
 o setSpecBasePath(String)
This function set the SpecBasePath to the string value passed with some data stripped.
 o setSpeed(int)
Sets the speed of execution to the value passed.
 o setupConsoleWindow()
This function creates the new Console window and the print stream
 o setUserPropFile(String)
Sets the user properties file.
 o setVerify(boolean)
Set verify flag
 o startOutputWindow()
Start output window
 o stopOutputWindow()
Stop output window

Variables

 o out
 public static PrintStream out
out is the PrintStream into which the trace messages will be written. This is assigned to the System.output stream by default

Constructors

 o Context
 public Context()

Methods

 o getValue
 public static int getValue(String s,
                            int deft)
This function returns the integer value given the String form of it. In case of any number format exception, the function returns default value.

Parameters:
s - String value passed
deft - the default value to be returned.
 o setupConsoleWindow
 public static void setupConsoleWindow()
This function creates the new Console window and the print stream

See Also:
ConsoleWindow
 o setSpecBasePath
 public static void setSpecBasePath(String basepath)
This function set the SpecBasePath to the string value passed with some data stripped.

Parameters:
basePath - The URL of the file
 o getSpecBasePath
 public static String getSpecBasePath()
returns the specbase path

 o addCachedDataSize
 public static void addCachedDataSize(int num)
Increments the the cached_data parameter by the integer passed.

Parameters:
num - increment value
 o getCachedDataSize
 public static int getCachedDataSize()
gets the cached data size.

Returns:
The cached_data value
 o IncrementNumCachedFiles
 public static void IncrementNumCachedFiles()
Increments the the num_cached_files parameter by 1.

 o getNumCachedFiles
 public static int getNumCachedFiles()
gets the numbef of cached files.

Returns:
The num_cached_files value
 o IncrementNumOpenFiles
 public static void IncrementNumOpenFiles()
Increments the number of Files open parameter. The number of files open parameter is used for debugging purposes to findout whether the finalizers are called or not

 o DecrementNumOpenFiles
 public static void DecrementNumOpenFiles()
Decrements the number of Files open parameter

 o getNumOpenFiles
 public static int getNumOpenFiles()
returns the number of files open

 o setBenchmarkRelPath
 public static void setBenchmarkRelPath(String rpath)
sets the benchmark relative path. For example if SpecBasepath is /var/htdocs/v11/spec, The relative benchmark path path for _201_compress is benchmarks/_201_compress. This function adds these two strings and forms the BasePath BasePath = /var/htdocs/v11/spec + benchmarks/_201_compress

Parameters:
rpath - Relative path of the benchmark
 o cdInput
 public static void cdInput()
This function changes the basepath to point to the input directory of the benchmark. this function just concatinates the "/input" to the existing basepath if it is not added already.

 o setNetworkAccess
 public static void setNetworkAccess(boolean flag)
Sets the network access flag

Parameters:
flag - Flag indicating the network access
 o getBasePath
 public static String getBasePath()
Returns the spec base path. This function is handly in loading the files from the relative directories.

 o isNetworkAccess
 public static boolean isNetworkAccess()
Indicates whether SpecJVMClient is running as an applet or application

 o setSpeed
 public static void setSpeed(int n)
Sets the speed of execution to the value passed. Depending on the user's selection, the speed of execution is set as 1% 10% or 100%

Parameters:
n - Speed selected by the user
 o getSpeed
 public static int getSpeed()
Returns the speed of the benchmark.

 o setCachedInputFlag
 public static void setCachedInputFlag(boolean cif)
Sets the CachedInput flag. The data is read from the Cache during the second run if this flag is set.

 o setBatch
 public static void setBatch(boolean b)
Sets the batch flag

Parameters:
b - boolean value for the batch flag
 o isBatch
 public static boolean isBatch()
Returns whether SpecJVMClient is running in batch mode

 o setGraphicsMode
 public static void setGraphicsMode(boolean mode)
Sets the graphics mode. Normally SepcJVM client runs with graphics disabled. This flag is for future extensions and debugging

 o getGraphicsMode
 public static boolean getGraphicsMode()
Returns the graphic mode flag value

 o setUserPropFile
 public static void setUserPropFile(String s)
Sets the user properties file. These properties are stored in the mail sent at the end of the test

Parameters:
s - Properties file name
 o getUserPropFile
 public static String getUserPropFile()
Returns the properties file name

 o isCachedInput
 public static boolean isCachedInput()
Returns the cached input flag

 o clearIOtime
 public static void clearIOtime()
Clears the IOtiming. This is normally done before starting a benchmark

 o addIOtime
 public static void addIOtime(long time)
Increments the IOTime by the value provided

Parameters:
time - Incremental value
 o getIOtime
 public static long getIOtime()
Returns the IO time

 o setCommandLineMode
 public static void setCommandLineMode(boolean value)
Set commandLineMode flag

 o getCommandLineMode
 public static boolean getCommandLineMode()
Get commandLineMode flag

 o setVerify
 public static void setVerify(boolean value)
Set verify flag

 o getVerify
 public static boolean getVerify()
Get verify flag

 o startOutputWindow
 public static void startOutputWindow()
Start output window

 o stopOutputWindow
 public static void stopOutputWindow()
Stop output window

 o appendWindow
 public static void appendWindow(String s)
Output to console window


All Packages  Class Hierarchy  This Package  Previous  Next  Index