testProportionMemoryAndDiskPerformance() Performance tests for a range of Memory Store - Disk Store combinations.
This demonstrates that a memory only store is approximately an order of magnitude
faster than a disk only store.
It also shows that double the performance of a Disk Only store can be obtained
with a maximum memory size of only 1.
testReadWriteThreads() Multi-thread read-write test with lots of threads
Just use MemoryStore to put max stress on cache
Values that work:
The get here will often load data, so it does not give raw cache performance.
Test element statistics, including get and getQuiet
eternal="false"
timeToIdleSeconds="5"
timeToLiveSeconds="10"
overflowToDisk="true"
jsr107 has no put quiet
Checks the expense of checking for duplicates
JSR107 has only one keyset command. It returns a Set rather than a list, so
duplicates are automatically handled.
31ms for 2000 keys, half in memory and half on disk
public void testProportionMemoryAndDiskPerformance() throws Exception(Code)
Performance tests for a range of Memory Store - Disk Store combinations.
This demonstrates that a memory only store is approximately an order of magnitude
faster than a disk only store.
It also shows that double the performance of a Disk Only store can be obtained
with a maximum memory size of only 1. Accordingly a Cache created without a
maximum memory size of less than 1 will issue a warning.
Threading changes were made in v1.41 of DiskStore. The before and after numbers are shown.
Multi-thread read-write test with lots of threads
Just use MemoryStore to put max stress on cache
Values that work:
The get here will often load data, so it does not give raw cache performance. See the similar test in CacheTest
for that.
testSizeMultipleCallsWithPutAndRemove
public void testSizeMultipleCallsWithPutAndRemove() throws Exception(Code)
Test size after multiple calls, with put and remove
testSizeWithPutAndRemove
public void testSizeWithPutAndRemove() throws Exception(Code)
Test size with put and remove.
It checks that size makes sense, and also that getKeys.size() matches getSize()
Tests cache, memory store and disk store sizes from config
jsr107 does not breakdowns of store sizes.
testSpoolThreadHandlesThreadKiller
public void testSpoolThreadHandlesThreadKiller() throws Exception(Code)
Tests what happens when an Element throws an Error on serialization. This mimics
what a nasty error like OutOfMemoryError could do.
Before a change to the SpoolAndExpiryThread to handle this situation this test failed and generated
the following log message.
Jun 28, 2006 7:17:16 PM net.sf.ehcache.store.DiskStore put
SEVERE: testThreadKillerCache: Elements cannot be written to disk store because the spool thread has died.
throws: Exception -
testToString
public void testToString() throws CacheException(Code)
Tests that the toString() method works.
Fields inherited from net.sf.ehcache.AbstractCacheTest