com.sun.grizzly.test.cachetest
Class ConcurrentCacheTester
java.lang.Object
com.sun.grizzly.test.cachetest.ConcurrentCacheTester
public class ConcurrentCacheTester
- extends Object
Tests the throughput for object instance caching in a concurrent environment.
Please provide feedback, opinions.
Only test the situation where the threads do the operation of interest and no work inbetween.
Reson is that the basic mechanism we want to test is how the caching algoritm
and new Instance with its GC compares during maximal load.
its only then their strengths and weaknesses really shows,
its also worst cases that often are of interest for real life designs.
the differences between caching or new Instance converges to 0 when the workinbetween increaes,
making it a very specific result.
TODO add long lived Objects test, that will move Objects into oldgen
-showversion -server -Xms512m -Xmx512m -XX:+AggressiveOpts -XX:+UseParallelOldGC -XX:+UseParallelGC
- Author:
- Gustav Trede
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
threadPool
protected final ThreadPoolExecutor threadPool
calibrationTargetError
protected final double calibrationTargetError
- See Also:
- Constant Field Values
ConcurrentCacheTester
public ConcurrentCacheTester()
main
public static void main(String[] argv)
throws Throwable
- performs a standard set of long running tests.
- Parameters:
args
- used for minutesPerTest, default is 3
- Throws:
Throwable
performRangeOfTests
public List<TestAndResult> performRangeOfTests(int minutesPerTest,
InstanceFactory factory)
throws Throwable
- Parameters:
factory
- InstanceFactory
minutesPerTest
-
- Returns:
- List
List
TestAndResult
- Throws:
Throwable
performRangeOfTests
public List<TestAndResult> performRangeOfTests(int minutesPerTest,
InstanceFactory objfactory,
Queue[] cacheImplementations,
Integer[] threadcounts,
boolean calibrationInfoToSystemErr)
throws Throwable
- Parameters:
minutesPerTest
- int
objfactory
- InstanceFactory
cacheImplementations
- instances of Queue
threadcounts
- int
calibrationInfoToSystemErr
- boolean
- Returns:
- List
List
TestAndResult
- Throws:
Throwable
calibrateAndExecuteTest
public void calibrateAndExecuteTest(TestAndResult test)
throws Throwable
- calibrates and runs a single test.
- Parameters:
test
- TestAndResult
- Throws:
Throwable
calibrate
protected void calibrate(TestAndResult test)
throws Throwable
- Throws:
Throwable
calcThreadOverhead
protected void calcThreadOverhead(TestAndResult test)
throws Throwable
- Throws:
Throwable
calibrate0
protected void calibrate0(TestAndResult test,
int targetsec,
int calibsec)
throws Throwable
- Throws:
Throwable
executeTest
protected double executeTest(TestAndResult test)
throws Throwable
- Throws:
Throwable
Copyright © 2012 Oracle Corporation. All Rights Reserved.