コード例 #1
0
ファイル: MemoryManager.cs プロジェクト: justinverhoef/abot
        public MemoryManager(IMemoryMonitor memoryMonitor)
        {
            if (memoryMonitor == null)
                throw new ArgumentNullException("memoryMonitor");

            _memoryMonitor = memoryMonitor;
        }
コード例 #2
0
ファイル: MemoryManager.cs プロジェクト: divyang4481/abot-1
        public MemoryManager(IMemoryMonitor memoryMonitor)
        {
            if (memoryMonitor == null)
            {
                throw new ArgumentNullException("memoryMonitor");
            }

            _memoryMonitor = memoryMonitor;
        }
コード例 #3
0
        public CoreMemoryManager(IMemoryMonitor memoryMonitor)
        {
            if (memoryMonitor == null)
            {
                throw new ArgumentNullException(nameof(memoryMonitor));
            }

            _memoryMonitor = memoryMonitor;
        }
コード例 #4
0
        public CachedMemoryMonitor(IMemoryMonitor memoryMonitor, int cacheExpirationInSeconds)
        {
            if (memoryMonitor == null)
                throw new ArgumentNullException("memoryMonitor");

            if (cacheExpirationInSeconds < 1)
                cacheExpirationInSeconds = 5;

            _memoryMonitor = memoryMonitor;

            UpdateCurrentUsageValue();

            _usageRefreshTimer = new Timer(cacheExpirationInSeconds * 1000);
            _usageRefreshTimer.Elapsed += (sender, e) => UpdateCurrentUsageValue();
            _usageRefreshTimer.Start();
        }
コード例 #5
0
        public CachedMemoryMonitor(IMemoryMonitor memoryMonitor, int cacheExpirationInSeconds)
        {
            if (memoryMonitor == null)
            {
                throw new ArgumentNullException(nameof(memoryMonitor));
            }

            if (cacheExpirationInSeconds < 1)
            {
                cacheExpirationInSeconds = 5;
            }

            _memoryMonitor = memoryMonitor;

            UpdateCurrentUsageValue();

            _usageRefreshTimer = new Timer(UpdateCurrentUsageValue, null, cacheExpirationInSeconds * 1000, cacheExpirationInSeconds * 1000);
        }
コード例 #6
0
        public CachedMemoryMonitor(IMemoryMonitor memoryMonitor, int cacheExpirationInSeconds)
        {
            if (memoryMonitor == null)
            {
                throw new ArgumentNullException("memoryMonitor");
            }

            if (cacheExpirationInSeconds < 1)
            {
                cacheExpirationInSeconds = 5;
            }

            _memoryMonitor = memoryMonitor;

            UpdateCurrentUsageValue();

            _usageRefreshTimer          = new Timer(cacheExpirationInSeconds * 1000);
            _usageRefreshTimer.Elapsed += (sender, e) => UpdateCurrentUsageValue();
            _usageRefreshTimer.Start();
        }