Java Doc for BenchBase.java in  » XML » tclib » com » sosnoski » xmlbench » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » tclib » com.sosnoski.xmlbench 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sosnoski.xmlbench.BenchBase

All known Subclasses:   com.sosnoski.xmlbench.BenchDocBase,  com.sosnoski.xmlbench.BenchSAX,
BenchBase
abstract public class BenchBase (Code)
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.
author:
   Dennis M. Sosnoski
version:
   1.2


Field Summary
final public static  intATTRCHAR_COUNT_INDEX
     Attribute character count index.
final public static  intATTRIBUTE_COUNT_INDEX
     Attribute count index.
final public static  intAVERAGE_SPACE_INDEX
     Last document memory usage.
final public static  intBUILD_AVERAGE_INDEX
     Average document build time result index.
final public static  intBUILD_MIN_INDEX
     Best document build time result index.
final public static  intCONTENT_COUNT_INDEX
     Content text segment count index.
final public static  intDELTA_MEMORY_INDEX
     Net change in memory usage from start to end.
final public static  intELEMENT_COUNT_INDEX
     Element count index.
final public static  intFIRST_SPACE_INDEX
     First document memory usage.
final public static  longGARBAGE_COLLECT_DELAY
     Total interval in milliseconds to wait for garbage collection.
final public static  longGARBAGE_UNIT_DELAY
     Interval in milliseconds to wait each time.
final public static  intINITIAL_MEMORY_INDEX
     Initial memory usage (before document construction).
final public static  intMODIFY_AVERAGE_INDEX
     Average modification time result index.
final public static  intMODIFY_MIN_INDEX
     Best modification time result index.
final public static  intSERIALIZE_AVERAGE_INDEX
     Average serialization time result index.
final public static  intSERIALIZE_MIN_INDEX
     Best serialization time result index.
final public static  intSERIALIZE_SIZE_INDEX
     Serialized size result index.
final public static  intSPACE_RESULT_COUNT
     Count of result values returned.
final public static  intTEXTCHAR_COUNT_INDEX
     Text character count index.
final public static  intTEXT_AVERAGE_INDEX
     Average document text generation time result index.
final public static  intTEXT_MIN_INDEX
     Best document text generation time result index.
final public static  intTIME_RESULT_COUNT
     Count of result values returned.
final public static  intUNSERIALIZE_AVERAGE_INDEX
     Average unserialization time walk time result index.
final public static  intUNSERIALIZE_MIN_INDEX
     Best unserialization time walk time result index.
final public static  intWALKED_SPACE_INDEX
     Memory usage change after walking document.
final public static  intWALK_AVERAGE_INDEX
     Average document walk time result index.
final public static  intWALK_MIN_INDEX
     Best document walk time result index.
final protected  Stringm_configName
     Name for this test configuration.
protected  Stringm_configVariant
     Optional variant information for test configuration.
protected static  longm_lastMemory
     Memory usage at start of test.
protected static  longm_lastTime
     Time at start of test.
protected  booleanm_printPass
     Flag for printing detailed pass results.
protected  PrintStreamm_printStream
     Destination for test results listing.
protected  booleanm_printSummary
     Flag for printing document summary information.
final public static  String[]s_spaceFullDescriptions
     Full descriptions of space test result values.
final public static  String[]s_spaceShortDescriptions
     Abbreviated descriptions of space test result values.
final public static  String[]s_timeFullDescriptions
     Full descriptions of time test result values.
final public static  String[]s_timeShortDescriptions
     Abbreviated descriptions of time test result values.

Constructor Summary
protected  BenchBase(String config)
     Constructor.

Method Summary
public  StringgetName()
     Get configuration name.
protected  voidinitMemory()
     Initializes the memory state prior to a test run.
protected  voidinitTime()
     Initializes the time prior to a test run.
protected  voidprintSummary(String lead, DocumentSummary info, PrintStream print)
     Print document summary information.
protected  intreportSpace(String test)
     Report the results of a memory test run.
protected  intreportTime(String test)
     Report the results of a time test run.
protected  voidreportValue(String lead, int value)
     Report a value.
abstract public  int[]runSpaceTest(int passes, int excludes, byte[][] texts)
     Main space test method.
abstract public  int[]runTimeTest(int passes, int excludes, byte[][] texts)
     Main time test method.
public  voidsetPrint(PrintStream print)
     Set output print stream for printing detailed test run results.
public  voidsetShowDocument(boolean show)
     Set flag for printing document summary information.
public  voidsetShowPass(boolean show)
     Set flag for printing individual test pass results.
protected  voidsetVariant(String variant)
     Set configuration variant information.
protected  inttestPassSpace()
     Find test pass space.
protected  inttestPassTime()
     Find test pass time.

Field Detail
ATTRCHAR_COUNT_INDEX
final public static int ATTRCHAR_COUNT_INDEX(Code)
Attribute character count index.



ATTRIBUTE_COUNT_INDEX
final public static int ATTRIBUTE_COUNT_INDEX(Code)
Attribute count index.



AVERAGE_SPACE_INDEX
final public static int AVERAGE_SPACE_INDEX(Code)
Last document memory usage.



BUILD_AVERAGE_INDEX
final public static int BUILD_AVERAGE_INDEX(Code)
Average document build time result index.



BUILD_MIN_INDEX
final public static int BUILD_MIN_INDEX(Code)
Best document build time result index.



CONTENT_COUNT_INDEX
final public static int CONTENT_COUNT_INDEX(Code)
Content text segment count index.



DELTA_MEMORY_INDEX
final public static int DELTA_MEMORY_INDEX(Code)
Net change in memory usage from start to end.



ELEMENT_COUNT_INDEX
final public static int ELEMENT_COUNT_INDEX(Code)
Element count index.



FIRST_SPACE_INDEX
final public static int FIRST_SPACE_INDEX(Code)
First document memory usage.



GARBAGE_COLLECT_DELAY
final public static long GARBAGE_COLLECT_DELAY(Code)
Total interval in milliseconds to wait for garbage collection.



GARBAGE_UNIT_DELAY
final public static long GARBAGE_UNIT_DELAY(Code)
Interval in milliseconds to wait each time.



INITIAL_MEMORY_INDEX
final public static int INITIAL_MEMORY_INDEX(Code)
Initial memory usage (before document construction).



MODIFY_AVERAGE_INDEX
final public static int MODIFY_AVERAGE_INDEX(Code)
Average modification time result index.



MODIFY_MIN_INDEX
final public static int MODIFY_MIN_INDEX(Code)
Best modification time result index.



SERIALIZE_AVERAGE_INDEX
final public static int SERIALIZE_AVERAGE_INDEX(Code)
Average serialization time result index.



SERIALIZE_MIN_INDEX
final public static int SERIALIZE_MIN_INDEX(Code)
Best serialization time result index.



SERIALIZE_SIZE_INDEX
final public static int SERIALIZE_SIZE_INDEX(Code)
Serialized size result index.



SPACE_RESULT_COUNT
final public static int SPACE_RESULT_COUNT(Code)
Count of result values returned.



TEXTCHAR_COUNT_INDEX
final public static int TEXTCHAR_COUNT_INDEX(Code)
Text character count index.



TEXT_AVERAGE_INDEX
final public static int TEXT_AVERAGE_INDEX(Code)
Average document text generation time result index.



TEXT_MIN_INDEX
final public static int TEXT_MIN_INDEX(Code)
Best document text generation time result index.



TIME_RESULT_COUNT
final public static int TIME_RESULT_COUNT(Code)
Count of result values returned.



UNSERIALIZE_AVERAGE_INDEX
final public static int UNSERIALIZE_AVERAGE_INDEX(Code)
Average unserialization time walk time result index.



UNSERIALIZE_MIN_INDEX
final public static int UNSERIALIZE_MIN_INDEX(Code)
Best unserialization time walk time result index.



WALKED_SPACE_INDEX
final public static int WALKED_SPACE_INDEX(Code)
Memory usage change after walking document.



WALK_AVERAGE_INDEX
final public static int WALK_AVERAGE_INDEX(Code)
Average document walk time result index.



WALK_MIN_INDEX
final public static int WALK_MIN_INDEX(Code)
Best document walk time result index.



m_configName
final protected String m_configName(Code)
Name for this test configuration.



m_configVariant
protected String m_configVariant(Code)
Optional variant information for test configuration.



m_lastMemory
protected static long m_lastMemory(Code)
Memory usage at start of test.



m_lastTime
protected static long m_lastTime(Code)
Time at start of test.



m_printPass
protected boolean m_printPass(Code)
Flag for printing detailed pass results.



m_printStream
protected PrintStream m_printStream(Code)
Destination for test results listing.



m_printSummary
protected boolean m_printSummary(Code)
Flag for printing document summary information.



s_spaceFullDescriptions
final public static String[] s_spaceFullDescriptions(Code)
Full descriptions of space test result values.



s_spaceShortDescriptions
final public static String[] s_spaceShortDescriptions(Code)
Abbreviated descriptions of space test result values.



s_timeFullDescriptions
final public static String[] s_timeFullDescriptions(Code)
Full descriptions of time test result values.



s_timeShortDescriptions
final public static String[] s_timeShortDescriptions(Code)
Abbreviated descriptions of time test result values.




Constructor Detail
BenchBase
protected BenchBase(String config)(Code)
Constructor.
Parameters:
  config - test configuration name




Method Detail
getName
public String getName()(Code)
Get configuration name. Returns the name of the document model used by this test, with any supplied variant information appended in parenthesis. document model name



initMemory
protected void initMemory()(Code)
Initializes the memory state prior to a test run. This method first requests a garbage collection operation, then waits for a fixed interval in order to encourage the JVM to do the collection. It also sets the start of test value for memory usage.



initTime
protected void initTime()(Code)
Initializes the time prior to a test run. This method justs sets the start of test time from the system clock.



printSummary
protected void printSummary(String lead, DocumentSummary info, PrintStream print)(Code)
Print document summary information. Prints the information with a supplied lead phrase.
Parameters:
  lead - lead text phrase for document summary
Parameters:
  info - document summary information
Parameters:
  print - stream on which to print



reportSpace
protected int reportSpace(String test)(Code)
Report the results of a memory test run. First attempts a garbage collection operation before computing the difference between the memory in use at the end of the test and that in use at the start of the test. Prints the space used by the test and sets the current space as the base for the next test.
Parameters:
  test - test description for display space used by test



reportTime
protected int reportTime(String test)(Code)
Report the results of a time test run. Prints the time taken for the last test and sets the current time as the start time for the next test.
Parameters:
  test - test description for display milliseconds taken for the test



reportValue
protected void reportValue(String lead, int value)(Code)
Report a value. Prints the leading text and the value with a space between, if printing is enabled.
Parameters:
  lead - leading text for test results
Parameters:
  value - value to be printed



runSpaceTest
abstract public int[] runSpaceTest(int passes, int excludes, byte[][] texts)(Code)
Main space test method. This must be implemented by the subclass to perform the sequence of space tests appropriate to the test platform.
Parameters:
  passes - number of passes of each test
Parameters:
  excludes - number of initialization passes excluded from averages
Parameters:
  texts - document texts for test result spaces array



runTimeTest
abstract public int[] runTimeTest(int passes, int excludes, byte[][] texts)(Code)
Main time test method. This must be implemented by the subclass to perform the sequence of speed tests appropriate to the test platform.
Parameters:
  passes - number of passes of each test
Parameters:
  excludes - number of initialization passes excluded from averages
Parameters:
  texts - document texts for test result times array



setPrint
public void setPrint(PrintStream print)(Code)
Set output print stream for printing detailed test run results.
Parameters:
  print - test results listing destination (null ifno listing output)



setShowDocument
public void setShowDocument(boolean show)(Code)
Set flag for printing document summary information.
Parameters:
  show - flag for document summary information to be printed



setShowPass
public void setShowPass(boolean show)(Code)
Set flag for printing individual test pass results.
Parameters:
  show - flag for document summary information to be printed



setVariant
protected void setVariant(String variant)(Code)
Set configuration variant information. This may be used by subclasses which need to deal with several variations of a single configuration.
Parameters:
  variant - configuration variant description, appended to name



testPassSpace
protected int testPassSpace()(Code)
Find test pass space. Besides returning the space for the last test pass, this sets the current space usage as the start of the next test pass. bytes of memory added by test pass (negative if space released)



testPassTime
protected int testPassTime()(Code)
Find test pass time. Besides returning the time for the last test pass, this sets the current time as the start of the next test pass. milliseconds taken for the test



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.