コード例 #1
0
        public DiskSpaceManager(
            Func <long> getCurrentMaxDiskQuota,
            Func <long> getCurrentDiskFullSafetySpace,
            Func <double> getDiskQuotaUsageTargetPercent,
            TimeSpan cleanupInterval)
        {
            this.cachedCurrentMaxDiskQuota         = new CachedValue <long>(getCurrentMaxDiskQuota);
            this.cachedCurrentDiskFullSafetySpace  = new CachedValue <long>(getCurrentDiskFullSafetySpace);
            this.cachedDiskQuotaUsageTargetPercent = new CachedValue <double>(getDiskQuotaUsageTargetPercent);

            this.GetAvailableSpace = d => new DriveInfo(d.FullName).AvailableFreeSpace;

            this.cleanupTimer = new DcaTimer("DiskSpaceManager.CleanupTimer", this.OnTimer, cleanupInterval);
            this.cleanupTimer.Start();
        }
コード例 #2
0
        internal EtlToInMemoryBufferPerformance(FabricEvents.ExtensionsEvents traceSource, string logSourceId)
        {
            this.traceSource      = traceSource;
            this.logSourceId      = logSourceId;
            this.perfCountersList = new List <PerformanceCounter>();

            bool success = this.SetupPerformanceCounters();

            if (success)
            {
                // Timer for tracing performance counters.
                string timerId = string.Concat(
                    this.logSourceId,
                    EtlToInMemoryCountersReadTimerIdSuffix);
                this.etlToInMemoryCountersReadTimer = new DcaTimer(
                    timerId,
                    this.ReadCounters,
                    TimeSpan.FromSeconds(ReadCountersTimerInterval));
            }
        }