spec.harness
Class Util

java.lang.Object
  extended by spec.harness.Util

public class Util
extends java.lang.Object


Constructor Summary
Util()
           
 
Method Summary
static boolean getBoolProperty(java.lang.String propname, java.lang.String bmName)
          Get the value of the property passed in as a boolean. 1.
static int getHwtCalcProperty(java.lang.String propname, java.lang.String bmName)
          Get the calculated int value of the property passed in. 1.
static int getIntProperty(java.lang.String propname, java.lang.String bmName)
          Get the value of the property passed in as a int. 1.
static long getLongProperty(java.lang.String propname, java.lang.String bmName)
          Get the value of the property passed in as a long. 1.
static java.lang.String getNextRawFileInDir()
           
static java.lang.String getNextRawFileInDir(java.io.File resultDir)
           
static java.lang.String getProperty(java.lang.String propname, java.lang.String bmName)
          Get the value of the property passed in. 1.
static long getTimeAsMillis(java.lang.String value)
          A time can be passed in as a long in millis, or with a unit on it, like '60s'.
static long getTimeAsSeconds(java.lang.String value)
          A time can be passed in as a long in millis, or with a unit on it, like '60s'.
static long getTimeProperty(java.lang.String propname, java.lang.String bmName)
          Get the value of the property passed in. 1.
static boolean isBenchmark(java.lang.String s)
           
static boolean isScimarkAndNotMonteCarlo(java.lang.String name)
           
static void printProperties(java.io.PrintStream ps, java.util.HashMap<java.lang.String,java.lang.String> reqs)
           
static void printProperties(java.io.PrintStream ps, java.util.Properties props)
           
static void printProperties(java.util.Properties props)
           
static void printReqs(java.util.HashMap<java.lang.String,java.lang.String> reqs)
           
static boolean sleep(long millis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getTimeProperty

public static long getTimeProperty(java.lang.String propname,
                                   java.lang.String bmName)
                            throws java.lang.NumberFormatException
Get the value of the property passed in. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value. A time can be passed in as a long in millis, or with a unit on it, like '60s'. Possible units are ms, millis seconds s, seconds m, minutes h, hours

Returns:
The value of the property, or what is in default.
Throws:
java.lang.NumberFormatException

getTimeAsMillis

public static long getTimeAsMillis(java.lang.String value)
                            throws java.lang.NumberFormatException
A time can be passed in as a long in millis, or with a unit on it, like '60s'. Possible units are ms, millis seconds s, seconds m, minutes h, hours

Returns:
The value of the property, or what is in default.
Throws:
java.lang.NumberFormatException

getTimeAsSeconds

public static long getTimeAsSeconds(java.lang.String value)
A time can be passed in as a long in millis, or with a unit on it, like '60s'. Possible units are ms, millis seconds s, seconds m, minutes h, hours

Returns:
The value of the property, or what is in default.
Throws:
java.lang.NumberFormatException

getHwtCalcProperty

public static int getHwtCalcProperty(java.lang.String propname,
                                     java.lang.String bmName)
                              throws java.lang.NumberFormatException
Get the calculated int value of the property passed in. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value. A hard ware thread property can be passed in as fixed or relativ. Examples: #hwt, same as number of hard ware threads on the machine (processors available to java) 2x#hwt, 2 times the number of hardware threads 4, will return 4.

Returns:
Number of hardware threads calculated based on value.
Throws:
java.lang.NumberFormatException

getBoolProperty

public static boolean getBoolProperty(java.lang.String propname,
                                      java.lang.String bmName)
Get the value of the property passed in as a boolean. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value.

Returns:
The value of the property, or what is in default.

getIntProperty

public static int getIntProperty(java.lang.String propname,
                                 java.lang.String bmName)
Get the value of the property passed in as a int. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value.

Returns:
The value of the property, or what is in default, or -1 if nothing is set.

getLongProperty

public static long getLongProperty(java.lang.String propname,
                                   java.lang.String bmName)
Get the value of the property passed in as a long. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value.

Returns:
The value of the property, or what is in default.

getProperty

public static java.lang.String getProperty(java.lang.String propname,
                                           java.lang.String bmName)
Get the value of the property passed in. 1. Get the value of the benchmark specific property, that is . 2. Get the value of the base property. 3. Use the default value.

Parameters:
propname - Name of the property (base name).
bmName - Name of the benchmark that gets the property.
Returns:
The value of the property, or null if all options are unset.

printProperties

public static void printProperties(java.util.Properties props)

printProperties

public static void printProperties(java.io.PrintStream ps,
                                   java.util.Properties props)

printReqs

public static void printReqs(java.util.HashMap<java.lang.String,java.lang.String> reqs)

printProperties

public static void printProperties(java.io.PrintStream ps,
                                   java.util.HashMap<java.lang.String,java.lang.String> reqs)

sleep

public static boolean sleep(long millis)

isScimarkAndNotMonteCarlo

public static boolean isScimarkAndNotMonteCarlo(java.lang.String name)

getNextRawFileInDir

public static java.lang.String getNextRawFileInDir()
                                            throws java.io.IOException
Throws:
java.io.IOException

getNextRawFileInDir

public static java.lang.String getNextRawFileInDir(java.io.File resultDir)
                                            throws java.io.IOException
Throws:
java.io.IOException

isBenchmark

public static boolean isBenchmark(java.lang.String s)