コード例 #1
0
 public InstrumentFactory(
     InstrumentStateSnapshotCache instrumentStateSnapshotCache = null,
     IRendererFactory rendererFactory = null,
     IPerformanceCounterInstanceFactory performanceCounterInstanceFactory = null)
 {
     _instrumentStateSnapshotCache = instrumentStateSnapshotCache ?? new InstrumentStateSnapshotCache();
     _rendererFactory = rendererFactory ?? new RendererFactory();
     _performanceCounterInstanceFactory = performanceCounterInstanceFactory ?? new PerformanceCounterInstanceInstanceFactory();
 }
コード例 #2
0
        internal Instrument(
            InstrumentType instrumentType,
            IInstrumentRenderer renderer,
            IInstrumentStateSnapshotCache instrumentStateSnapshotCache           = null,
            IPerformanceCounterInstanceFactory performanceCounterInstanceFactory = null,
            IInstrumentRenderHelper instrumentRenderHelper = null,
            IInstrumentFormFactory instrumentFormFactory   = null
            )
        {
            Type     = instrumentType;
            Renderer = renderer;
            _instrumentStateSnapshotCache = instrumentStateSnapshotCache ?? new InstrumentStateSnapshotCache();
            _instrumentRenderHelper       = instrumentRenderHelper ?? new InstrumentRenderHelper();
            _instrumentFormFactory        = instrumentFormFactory ?? new InstrumentFormFactory();
            var performanceCounterInstanceFactory1 = performanceCounterInstanceFactory ?? new PerformanceCounterInstanceInstanceFactory();

            _renderedFramesCounter = performanceCounterInstanceFactory1.CreatePerformanceCounterInstance(Application.ProductName,
                                                                                                         $"Rendered Frames per second - {instrumentType}");
            _skippedFramesCounter = performanceCounterInstanceFactory1.CreatePerformanceCounterInstance(Application.ProductName,
                                                                                                        $"Skipped Frames per second - {instrumentType}");
            _totalFramesCounter = performanceCounterInstanceFactory1.CreatePerformanceCounterInstance(Application.ProductName,
                                                                                                      $"Total Frames per second - {instrumentType}");
        }
コード例 #3
0
 public PerformanceCounterInstaller(IPerformanceCounterInstanceFactory performanceCounterInstanceFactory = null)
 {
     _performanceCounterInstanceFactory = performanceCounterInstanceFactory ??
                                          new PerformanceCounterInstanceInstanceFactory();
 }