示例#1
0
        public HddLoadSingleVolumeBase(string logicalVolume)
        {
            this.logicalVolumeInstancenName = HddTools.GetPerformanceCounterInstanceName(logicalVolume);

            if (string.IsNullOrEmpty(this.logicalVolumeInstancenName))
            {
                throw new ArgumentException(string.Format(Wsapm.Core.Resources.Wsapm_Core.HddLoadSingleVolumeBase_LogicalVolumeCannotBeFound, this.logicalVolumeInstancenName));
            }

            this.performanceCounterDiskBytesPerSecond = new PerformanceCounter(CategoryName, CounterName, logicalVolumeInstancenName);
        }
示例#2
0
        public HddLoadAverage() : base()
        {
            this.performanceCounters = new Dictionary <string, HddLoadSingleVolumeAverage>();

            var availableLogicalVolumes = HddTools.GetAvailableLogicalVolumeNames();

            foreach (var volume in availableLogicalVolumes)
            {
                var hddLoadSingleVolumeAverage = new HddLoadSingleVolumeAverage(volume);
                this.performanceCounters.Add(volume, hddLoadSingleVolumeAverage);
            }
        }
示例#3
0
        public HddLoadCurrent(TimeSpan timerInterval) : base()
        {
            this.performanceCounters = new Dictionary <string, HddLoadSingleVolumeCurrent>();

            var availableLogicalVolumes = HddTools.GetAvailableLogicalVolumeNames();

            foreach (var volume in availableLogicalVolumes)
            {
                var hddLoadSingleVolumeCcurrent = new HddLoadSingleVolumeCurrent(volume);
                this.performanceCounters.Add(volume, hddLoadSingleVolumeCcurrent);
            }
        }
示例#4
0
 /// <summary>
 /// Gets a string array with available logical drive names.
 /// </summary>
 /// <returns>A string array containing all logical drive names on the machine. Might be an empty array if there are no logical drives present.</returns>
 public static string[] GetAvailableLogicalVolumeNames()
 {
     return(HddTools.GetAvailableLogicalVolumeNames());
 }