|
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Object | +--com.sosnoski.xmlbench.BenchBase
Base class for XML benchmark tests. This class provides some basic methods used by the testing. It must be subclassed for each particular parser or document representation to be tested.
| Field Summary | |
static int |
ATTRCHAR_COUNT_INDEX
Attribute character count index. |
static int |
ATTRIBUTE_COUNT_INDEX
Attribute count index. |
static int |
AVERAGE_SPACE_INDEX
Last document memory usage. |
static int |
BUILD_AVERAGE_INDEX
Average document build time result index. |
static int |
BUILD_MIN_INDEX
Best document build time result index. |
static int |
CONTENT_COUNT_INDEX
Content text segment count index. |
static int |
DELTA_MEMORY_INDEX
Net change in memory usage from start to end. |
static int |
ELEMENT_COUNT_INDEX
Element count index. |
static int |
FIRST_SPACE_INDEX
First document memory usage. |
static long |
GARBAGE_COLLECT_DELAY
Total interval in milliseconds to wait for garbage collection. |
static long |
GARBAGE_UNIT_DELAY
Interval in milliseconds to wait each time. |
static int |
INITIAL_MEMORY_INDEX
Initial memory usage (before document construction). |
protected java.lang.String |
m_configName
Name for this test configuration. |
protected java.lang.String |
m_configVariant
Optional variant information for test configuration. |
protected static long |
m_lastMemory
Memory usage at start of test. |
protected static long |
m_lastTime
Time at start of test. |
protected boolean |
m_printPass
Flag for printing detailed pass results. |
protected java.io.PrintStream |
m_printStream
Destination for test results listing. |
protected boolean |
m_printSummary
Flag for printing document summary information. |
static int |
MODIFY_AVERAGE_INDEX
Average modification time result index. |
static int |
MODIFY_MIN_INDEX
Best modification time result index. |
static java.lang.String[] |
s_spaceFullDescriptions
Full descriptions of space test result values. |
static java.lang.String[] |
s_spaceShortDescriptions
Abbreviated descriptions of space test result values. |
static java.lang.String[] |
s_timeFullDescriptions
Full descriptions of time test result values. |
static java.lang.String[] |
s_timeShortDescriptions
Abbreviated descriptions of time test result values. |
static int |
SERIALIZE_AVERAGE_INDEX
Average serialization time result index. |
static int |
SERIALIZE_MIN_INDEX
Best serialization time result index. |
static int |
SERIALIZE_SIZE_INDEX
Serialized size result index. |
static int |
SPACE_RESULT_COUNT
Count of result values returned. |
static int |
TEXT_AVERAGE_INDEX
Average document text generation time result index. |
static int |
TEXT_MIN_INDEX
Best document text generation time result index. |
static int |
TEXTCHAR_COUNT_INDEX
Text character count index. |
static int |
TIME_RESULT_COUNT
Count of result values returned. |
static int |
UNSERIALIZE_AVERAGE_INDEX
Average unserialization time walk time result index. |
static int |
UNSERIALIZE_MIN_INDEX
Best unserialization time walk time result index. |
static int |
WALK_AVERAGE_INDEX
Average document walk time result index. |
static int |
WALK_MIN_INDEX
Best document walk time result index. |
static int |
WALKED_SPACE_INDEX
Memory usage change after walking document. |
| Constructor Summary | |
protected |
BenchBase(java.lang.String config)
Constructor. |
| Method Summary | |
java.lang.String |
getName()
Get configuration name. |
protected void |
initMemory()
Initializes the memory state prior to a test run. |
protected void |
initTime()
Initializes the time prior to a test run. |
protected void |
printSummary(java.lang.String lead,
DocumentSummary info,
java.io.PrintStream print)
Print document summary information. |
protected int |
reportSpace(java.lang.String test)
Report the results of a memory test run. |
protected int |
reportTime(java.lang.String test)
Report the results of a time test run. |
protected void |
reportValue(java.lang.String lead,
int value)
Report a value. |
abstract int[] |
runSpaceTest(int passes,
int excludes,
byte[][] texts)
Main space test method. |
abstract int[] |
runTimeTest(int passes,
int excludes,
byte[][] texts)
Main time test method. |
void |
setPrint(java.io.PrintStream print)
Set output print stream for printing detailed test run results. |
void |
setShowDocument(boolean show)
Set flag for printing document summary information. |
void |
setShowPass(boolean show)
Set flag for printing individual test pass results. |
protected void |
setVariant(java.lang.String variant)
Set configuration variant information. |
protected int |
testPassSpace()
Find test pass space. |
protected int |
testPassTime()
Find test pass time. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int BUILD_MIN_INDEX
public static final int BUILD_AVERAGE_INDEX
public static final int WALK_MIN_INDEX
public static final int WALK_AVERAGE_INDEX
public static final int TEXT_MIN_INDEX
public static final int TEXT_AVERAGE_INDEX
public static final int SERIALIZE_MIN_INDEX
public static final int SERIALIZE_AVERAGE_INDEX
public static final int UNSERIALIZE_MIN_INDEX
public static final int UNSERIALIZE_AVERAGE_INDEX
public static final int MODIFY_MIN_INDEX
public static final int MODIFY_AVERAGE_INDEX
public static final int SERIALIZE_SIZE_INDEX
public static final int ELEMENT_COUNT_INDEX
public static final int CONTENT_COUNT_INDEX
public static final int ATTRIBUTE_COUNT_INDEX
public static final int TEXTCHAR_COUNT_INDEX
public static final int ATTRCHAR_COUNT_INDEX
public static final int TIME_RESULT_COUNT
public static final int INITIAL_MEMORY_INDEX
public static final int DELTA_MEMORY_INDEX
public static final int FIRST_SPACE_INDEX
public static final int AVERAGE_SPACE_INDEX
public static final int WALKED_SPACE_INDEX
public static final int SPACE_RESULT_COUNT
public static final java.lang.String[] s_timeShortDescriptions
public static final java.lang.String[] s_timeFullDescriptions
public static final java.lang.String[] s_spaceShortDescriptions
public static final java.lang.String[] s_spaceFullDescriptions
public static final long GARBAGE_COLLECT_DELAY
public static final long GARBAGE_UNIT_DELAY
protected static long m_lastMemory
protected static long m_lastTime
protected final java.lang.String m_configName
protected java.lang.String m_configVariant
protected java.io.PrintStream m_printStream
protected boolean m_printSummary
protected boolean m_printPass
| Constructor Detail |
protected BenchBase(java.lang.String config)
config - test configuration name| Method Detail |
protected void initMemory()
protected void initTime()
protected void reportValue(java.lang.String lead,
int value)
lead - leading text for test resultsvalue - value to be printedprotected int testPassTime()
protected int testPassSpace()
protected int reportTime(java.lang.String test)
test - test description for displayprotected int reportSpace(java.lang.String test)
test - test description for display
protected void printSummary(java.lang.String lead,
DocumentSummary info,
java.io.PrintStream print)
lead - lead text phrase for document summaryinfo - document summary informationprint - stream on which to printpublic java.lang.String getName()
protected void setVariant(java.lang.String variant)
variant - configuration variant description, appended to namepublic void setPrint(java.io.PrintStream print)
print - test results listing destination (null if
no listing output)public void setShowDocument(boolean show)
show - flag for document summary information to be printedpublic void setShowPass(boolean show)
show - flag for document summary information to be printed
public abstract int[] runTimeTest(int passes,
int excludes,
byte[][] texts)
passes - number of passes of each testexcludes - number of initialization passes excluded from averagestexts - document texts for test
public abstract int[] runSpaceTest(int passes,
int excludes,
byte[][] texts)
passes - number of passes of each testexcludes - number of initialization passes excluded from averagestexts - document texts for test
|
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||