]> git.ipfire.org Git - thirdparty/asterisk.git/commit
test_sorcery_memory_cache_thrash: Add unit tests for thrashing the memory cache. 33/833/1
authorJoshua Colp <jcolp@digium.com>
Tue, 2 Jun 2015 15:20:00 +0000 (12:20 -0300)
committerMark Michelson <mmichelson@digium.com>
Wed, 8 Jul 2015 19:35:02 +0000 (14:35 -0500)
commit8b2bad77407bb62471bfd5476cbf387ccaaff906
tree8f360b32f55893270e3dac41915ffacfa421d25c
parent8575c4f18dd4cd05044a15b4b9a885984ad9c5ee
test_sorcery_memory_cache_thrash: Add unit tests for thrashing the memory cache.

This change adds a CLI command which can perform memory cache thrashing as well
as unit tests which perform thrashing under the following configurations:

1. Low number of unique objects that go stale after 1 second
2. Low number of unique objects that expire after 1 second
3. Low number of unique objects which are constantly updated
4. Large number of unique objects which exceed a defined cache size
5. Large number of unique objects which exceed a defined cache size
   that also expire and go stale rapidly
6. Large number of unique objects which expire and go stale rapidly
7. Large number of unique objects

For all of the above there are a large number of threads constantly
attempting to retrieve random objects and each test runs for a few
seconds.

ASTERISK-25067
Reported by: Matt Jordan

Change-Id: I8c8ceff977332c80ed4a31f10d694d48552b2f78
res/res_sorcery_memory_cache.c
tests/test_sorcery_memory_cache_thrash.c [new file with mode: 0644]