def test_fifo_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio(self.pdf, cache.FifoCache(r*self.n)) self.assertLess(np.abs(h - r), 0.01)
def test_rand_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio(self.pdf, cache.RandEvictionCache(r*self.n)) self.assertLess(np.abs(h - r), 0.01)
def test_rand_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio( self.pdf, cache.RandEvictionCache(r * self.n)) assert np.abs(h - r) < 0.01
def test_fifo_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio(self.pdf, cache.FifoCache(r * self.n)) assert np.abs(h - r) < 0.01
def test_in_cache_lfu_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio( self.pdf, cache.InCacheLfuCache(r * self.n)) assert np.abs(h - r) < 0.01
def test_lru_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio(self.pdf, cache.LruCache(r * self.n)) self.assertLess(np.abs(h - r), 0.01)
def test_in_cache_lfu_cache(self): r = 0.1 h = cacheperf.numeric_cache_hit_ratio(self.pdf, cache.InCacheLfuCache(r*self.n)) self.assertLess(np.abs(h - r), 0.01)