jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1043897 - /jackrabbit/trunk/test/performance/README.txt
Date Thu, 09 Dec 2010 11:27:41 GMT
Author: jukka
Date: Thu Dec  9 11:27:41 2010
New Revision: 1043897

URL: http://svn.apache.org/viewvc?rev=1043897&view=rev
Log:
JCR-2695: Jackrabbit performance test suite

Add instructions for creating new tests

Modified:
    jackrabbit/trunk/test/performance/README.txt

Modified: jackrabbit/trunk/test/performance/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/README.txt?rev=1043897&r1=1043896&r2=1043897&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/README.txt (original)
+++ jackrabbit/trunk/test/performance/README.txt Thu Dec  9 11:27:41 2010
@@ -52,4 +52,30 @@ To enable a profiler, use the -Dagentlib
 
     mvn clean install -Dagentlib=hprof=cpu=samples,depth=10
 
+Adding a new performance test
+-----------------------------
+
+The tests run by this performance test suite are listed in the
+testPerformance() method of the AbstractPerformanceTest class in
+the org.apache.jackrabbit.performance package of the jackrabbit-perf-base
+component that you can find in the ./base directory.
+
+Each test is a subclass of the AbstractTest class in that same package,
+and you need to implement at least the abstract runTest() method when
+creating a new test. The runTest() method should contain the code whose
+performance you want to measure. For best measurement results the method
+should normally take something between 0.1 to 10 seconds to execute, so
+you may need to add a constant-size loop around your code like is done
+for example in the LoginTest class. The test suite compares relative
+performance between different Jackrabbit versions, so the absolute time
+taken by the test method is irrelevant.
+
+Many performance tests need some setup and teardown code for things like
+building the content tree against which the test is being run. Such work
+should not be included in the runTest() method to prevent affecting the
+performance measurements. Instead you can override the before/afterTest()
+and before/afterSuite() methods that get called respectively before and
+after each individual test iteration and the entire test suite. See for
+example the SetPropertyTest class for an example of how these methods
+are best used.
 



Mime
View raw message