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); }
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); } }
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); } }
/// <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()); }