public CPUPerformancePart(string partID, CPUPerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new CPUPerformancePartConfig(config); this.mdrfWriter = mdrfWriter; Log.SetDefaultNamedValueSetForEmitter(Logging.MesgType.All, new NamedValueSet() { { "noMDRF" } }); sampleIntervalTimer = new QpcTimer() { TriggerInterval = config.SampleInterval, AutoReset = true }.Start(); aggregationIntervalTimer = new QpcTimer() { TriggerInterval = config.AggregationInterval, AutoReset = true }.Start(); h1Grp = new MDRFHistogramGroupSource("{0}.h1".CheckedFormat(partID), h1, Config.SampleGroupsFileIndexUserRowFlagBits); h10Grp = new MDRFHistogramGroupSource("{0}.h10".CheckedFormat(partID), h10, Config.SampleGroupsFileIndexUserRowFlagBits); h30Grp = new MDRFHistogramGroupSource("{0}.h30".CheckedFormat(partID), h30, Config.SampleGroupsFileIndexUserRowFlagBits); ah1 = new Histogram(h1); ah10 = new Histogram(h10); ah30 = new Histogram(h30); ah1Grp = new MDRFHistogramGroupSource("{0}.ah1".CheckedFormat(partID), ah1, Config.AggregateGroupsFileIndexUserRowFlagBits); ah10Grp = new MDRFHistogramGroupSource("{0}.ah10".CheckedFormat(partID), ah10, Config.AggregateGroupsFileIndexUserRowFlagBits); ah30Grp = new MDRFHistogramGroupSource("{0}.ah30".CheckedFormat(partID), ah30, Config.AggregateGroupsFileIndexUserRowFlagBits); mdrfWriter.Add(h1Grp.GroupInfo, h10Grp.GroupInfo, h30Grp.GroupInfo, ah1Grp.GroupInfo, ah10Grp.GroupInfo, ah30Grp.GroupInfo); }
public PerformanceCountersPart(PerformanceCountersPartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(config.PartID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new PerformanceCountersPartConfig(config); this.mdrfWriter = mdrfWriter; // we trigger acquiring a new sample two times a second sampleIntervalTimer = new QpcTimer() { TriggerInterval = Config.SampleInterval, AutoReset = true }.Start(); performanceCounterTrackerArray = Config.PerformanceCounterSpecArray.Select(pcs => new PerformanceCounterTracker(Log, pcs)).ToArray(); pccTupleArray = performanceCounterTrackerArray.GroupBy(pct => pct.pcc, (pcc, pctSet) => Tuple.Create(pcc, pctSet.ToArray())).ToArray(); groupInfo = new MDRF.Writer.GroupInfo() { Name = "{0}.Grp".CheckedFormat(PartID), GroupBehaviorOptions = MDRF.Writer.GroupBehaviorOptions.UseVCHasBeenSetForTouched | MDRF.Writer.GroupBehaviorOptions.IncrSeqNumOnTouched, FileIndexUserRowFlagBits = (ulong)Config.PerformanceCounterGroupsFileIndexUserRowFlagBits, GroupPointInfoArray = performanceCounterTrackerArray.Select(pct => pct.gpInfo).ToArray(), }; mdrfWriter.Add(groupInfo); noMDRFLogger = new Logging.Logger(PartID).SetDefaultNamedValueSetForEmitter(Logging.LogGate.All, new NamedValueSet() { { "noMDRF" } }); }
public PingPerformancePart(string partID, PingPerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new PingPerformancePartConfig(config); this.mdrfWriter = mdrfWriter; sampleIntervalTimer = new QpcTimer() { TriggerInterval = Config.SampleInterval, AutoReset = true }.Start(); aggregationIntervalTimer = new QpcTimer() { TriggerInterval = Config.AggregationInterval, AutoReset = true }.Start(); AddExplicitDisposeAction(() => Release()); pingTrackerArray = Config.PingTargetArray.Select(hostNameOrAddress => new PingTracker(hostNameOrAddress, binBoundariesArray, Config, this)).ToArray(); pingTrackerArray.DoForEach(pt => mdrfWriter.Add(pt.hGrp.GroupInfo)); noMDRFLogger = new Logging.Logger(PartID).SetDefaultNamedValueSetForEmitter(Logging.LogGate.All, new NamedValueSet() { { "noMDRF" } }); }
public ProcessPerformancePart(string partID, ProcessPerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.1).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new ProcessPerformancePartConfig(config); this.mdrfWriter = mdrfWriter; sampleIntervalTimer = new QpcTimer() { TriggerInterval = config.SampleInterval, AutoReset = true }.Start(); Log.SetDefaultNamedValueSetForEmitter(Logging.MesgType.All, new NamedValueSet() { { "noMDRF" } }); ProcessDeltaOccurrenceInfo = new MDRF.Writer.OccurrenceInfo() { Name = "{0}.ProcessDelta".CheckedFormat(PartID), Comment = "Used to record all process additions, removals, and migrations to/from the active set", FileIndexUserRowFlagBits = config.ProcessDeltaOccurrenceFileIndexUserRowFlagBits, }; activeSetItemTrackerArray = Enumerable.Range(1, Math.Max(config.ActiveSetSize, 1)).Select(groupNum => new ActiveSetItemTracker("{0}.ActSet{1:d2}".CheckedFormat(PartID, groupNum), Config.ActiveSetGroupsFileIndexUserRowFlagBits)).ToArray(); activeSetItemTrackerArrayLength = activeSetItemTrackerArray.Length; activeSetMapGroup = new ActiveSetMapGroupTracker(config.ActiveSetSize, "{0}.ActSetMap".CheckedFormat(PartID), Config.ActiveSetMapGroupFileIndexUserRowFlagBits); GroupInfoArray = activeSetItemTrackerArray.Select(ast => ast.GroupInfo).ToArray(); mdrfWriter.Add(ProcessDeltaOccurrenceInfo); mdrfWriter.Add(activeSetMapGroup.GroupInfo); mdrfWriter.AddRange(GroupInfoArray); }
public FileRWPerformancePart(string partID, FileRWPerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new FileRWPerformancePartConfig(config); this.mdrfWriter = mdrfWriter; // we trigger acquiring a new sample two times a second sampleIntervalTimer = new QpcTimer() { TriggerInterval = Config.SampleInterval, AutoReset = true }.Start(); aggregationIntervalTimer = new QpcTimer() { TriggerInterval = Config.AggregationInterval, AutoReset = true }.Start(); AddExplicitDisposeAction(() => Release()); ahReadNormal = new Histogram(hReadNormal); ahReadThrough = new Histogram(hReadThrough); ahWriteThrough = new Histogram(hWriteThrough); avgRatesGroup = new MDRF.Writer.GroupInfo() { Name = "{0}.avgRates".CheckedFormat(PartID), GroupBehaviorOptions = MDRF.Writer.GroupBehaviorOptions.UseVCHasBeenSetForTouched | MDRF.Writer.GroupBehaviorOptions.IncrSeqNumOnTouched, FileIndexUserRowFlagBits = (ulong)Config.AggregateGroupsFileIndexUserRowFlagBits, GroupPointInfoArray = new MDRF.Writer.GroupPointInfo[] { peakReadNormalRateGPI = new MDRF.Writer.GroupPointInfo() { Name = "peakReadRate", ValueCST = ContainerStorageType.Double, VC = new ValueContainer(0.0) }, peakReadThroughRateGPI = new MDRF.Writer.GroupPointInfo() { Name = "peakReadThroughRate", ValueCST = ContainerStorageType.Double, VC = new ValueContainer(0.0) }, peakWriteThroughRateGPI = new MDRF.Writer.GroupPointInfo() { Name = "peakWriteThroughRate", ValueCST = ContainerStorageType.Double, VC = new ValueContainer(0.0) }, }, Touched = true, }; accumTupleArray = new Tuple <MDRFHistogramGroupSource, MDRFHistogramGroupSource> [] { Tuple.Create(new MDRFHistogramGroupSource("{0}.hReadNormal".CheckedFormat(PartID), hReadNormal, Config.SampleGroupsFileIndexUserRowFlagBits), new MDRFHistogramGroupSource("{0}.ahReadNormal".CheckedFormat(PartID), ahReadNormal, Config.AggregateGroupsFileIndexUserRowFlagBits)), Tuple.Create(new MDRFHistogramGroupSource("{0}.hReadThrough".CheckedFormat(PartID), hReadThrough, Config.SampleGroupsFileIndexUserRowFlagBits), new MDRFHistogramGroupSource("{0}.ahReadThrough".CheckedFormat(PartID), ahReadThrough, Config.AggregateGroupsFileIndexUserRowFlagBits)), Tuple.Create(new MDRFHistogramGroupSource("{0}.hWriteThrough".CheckedFormat(PartID), hWriteThrough, Config.SampleGroupsFileIndexUserRowFlagBits), new MDRFHistogramGroupSource("{0}.ahWriteThrough".CheckedFormat(PartID), ahWriteThrough, Config.AggregateGroupsFileIndexUserRowFlagBits)), }; IEnumerable <Tuple <MDRFHistogramGroupSource, MDRFHistogramGroupSource> > registerGroupsSet = ((Config.UseFileFlagNoBuffering) ? accumTupleArray : new [] { accumTupleArray[0], accumTupleArray[2] }); mdrfWriter.Add(avgRatesGroup); mdrfWriter.AddRange(registerGroupsSet.Select(t => t.Item1.GroupInfo).Concat(registerGroupsSet.Select(t => t.Item2.GroupInfo))); noMDRFLogger = new Logging.Logger(PartID).SetDefaultNamedValueSetForEmitter(Logging.LogGate.All, new NamedValueSet() { { "noMDRF" } }); }
public NetIfacePerformancePart(string partID, NetIfacePerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new NetIfacePerformancePartConfig(config); this.mdrfWriter = mdrfWriter; Log.SetDefaultNamedValueSetForEmitter(Logging.MesgType.All, new NamedValueSet() { { "noMDRF" } }); sampleRecordingIntervalTimer = new QpcTimer() { TriggerInterval = config.SampleRecordingInterval, AutoReset = true }.Start(); sampleIntervalTimer = new QpcTimer() { TriggerInterval = config.SampleRecordingInterval.Min((0.5).FromSeconds()), AutoReset = true }.Start(); netIfaceSettingChangeOccurrence = new MDRF.Writer.OccurrenceInfo() { Name = "{0}.SettingChange".CheckedFormat(PartID), Comment = "Used to record all network adapter setting changes", FileIndexUserRowFlagBits = Config.ChangeOccurrenceFileIndexUserRowFlagBits }; netIfaceStatusChangeOccurrence = new MDRF.Writer.OccurrenceInfo() { Name = "{0}.StatusChange".CheckedFormat(PartID), Comment = "Used to record all network adapter state changes", FileIndexUserRowFlagBits = Config.ChangeOccurrenceFileIndexUserRowFlagBits }; mdrfWriter.Add(netIfaceSettingChangeOccurrence, netIfaceStatusChangeOccurrence); NetworkInterface[] netInterfacesArray = NetworkInterface.GetAllNetworkInterfaces().Where(ni => ni.NetworkInterfaceType != NetworkInterfaceType.Tunnel && ni.NetworkInterfaceType != NetworkInterfaceType.Loopback).ToArray(); netIfaceTrackerArray = netInterfacesArray.Select((netIface, idx) => new NetIfaceTracker(PartID, netIface, idx + 1, config.StatisticsGroupsFileIndexUserRowFlagBits)).ToArray(); netIfaceTrackerArray.DoForEach(nit => netIfaceTrackerDictionary[nit.name] = nit); netIfaceTrackerArray.DoForEach(nit => mdrfWriter.Add(nit.groupInfo)); }
public SerialEchoPerformancePart(string partID, SerialEchoPerformancePartConfig config, PartsLib.Tools.MDRF.Writer.IMDRFWriter mdrfWriter) : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion0.Build(waitTimeLimit: (0.10).FromSeconds(), goOnlineAndOfflineHandling: GoOnlineAndGoOfflineHandling.All)) { Config = new SerialEchoPerformancePartConfig(config); this.mdrfWriter = mdrfWriter; sampleIntervalTimer = new QpcTimer() { TriggerInterval = Config.SampleInterval, AutoReset = true }.Start(); aggregationIntervalTimer = new QpcTimer() { TriggerInterval = Config.AggregationInterval, AutoReset = true }.Start(); AddExplicitDisposeAction(() => Release()); int targetCount = 1; serialEchoTrackerArray = Config.PortTargetSpecArray.Select(portTargetSpec => new SerialEchoTracker("SerialEchoPort_{0:d2}".CheckedFormat(targetCount++), portTargetSpec, binBoundariesArray, Config, this, Log)).ToArray(); serialEchoTrackerArray.DoForEach(pt => mdrfWriter.Add(pt.hGrp.GroupInfo)); noMDRFLogger = new Logging.Logger(PartID).SetDefaultNamedValueSetForEmitter(Logging.LogGate.All, new NamedValueSet() { { "noMDRF" } }); }