コード例 #1
0
        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);
        }
コード例 #2
0
 public CPUPerformancePartConfig(CPUPerformancePartConfig other)
 {
     SampleGroupsFileIndexUserRowFlagBits    = other.SampleGroupsFileIndexUserRowFlagBits;
     AggregateGroupsFileIndexUserRowFlagBits = other.AggregateGroupsFileIndexUserRowFlagBits;
     SampleInterval        = other.SampleInterval;
     AggregationInterval   = other.AggregationInterval;
     ProcessorAffinityMask = other.ProcessorAffinityMask;
 }