示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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)