def __init__(self, conn, get_vms, stats_cache, stats_flags=0, ttl=_TTL): self._conn = conn self._get_vms = get_vms self._stats_cache = stats_cache self._stats_flags = stats_flags self._skip_doms = ExpiringCache(ttl) self._sampling = threading.Semaphore() # used as glorified counter self._log = logging.getLogger("virt.sampling.VMBulkSampler")
def __init__(self, conn, get_vms, stats_cache, stats_types=BULK_STATS_TYPES, ttl=_TTL): self._conn = conn self._get_vms = get_vms self._stats_cache = stats_cache self._stats_types = stats_types self._skip_doms = ExpiringCache(ttl) self._sampling = threading.Semaphore() # used as glorified counter self._log = logging.getLogger("virt.sampling.VMBulkstatsMonitor")