del self.rrset[i]
-class CacheStats:
+class CacheStatistics:
"""Cache Statistics
"""
self.misses = 0
def clone(self):
- return CacheStats(self.hits, self.misses)
+ return CacheStatistics(self.hits, self.misses)
class CacheBase:
def __init__(self):
self.lock = _threading.Lock()
- self.statistics = CacheStats()
+ self.statistics = CacheStatistics()
def reset_statistics(self):
"""Reset all statistics to zero."""
Two thread-safe cache implementations are provided, a simple
dictionary-based Cache, and an LRUCache which provides cache size
-control suitable for use in web crawlers.
+control suitable for use in web crawlers. Both are subclasses of
+a common base class which provides basic statistics. The LRUCache can
+also provide a hits count per cache entry.
+
+.. autoclass:: dns.resolver.CacheBase
+ :members:
.. autoclass:: dns.resolver.Cache
:members:
.. autoclass:: dns.resolver.LRUCache
:members:
+.. autoclass:: dns.resolver.CacheStatistics
+ :members: