Example #1
0
        public DiagnosticObserverBenchmark()
        {
            var services = new ServiceCollection();

            services.AddSingleton <DiagnosticProcessorObserver>();
            services.AddSingleton <DiagnosticAdapterProcessorObserver>();
            services.AddSingleton <IDiagnosticProcessor, CrashDiagnosticProcessorMS>();
            services.AddSingleton <IDiagnosticProcessor, CrashDiagnosticProcessor>();
            services.AddSingleton <ILoggerFactory, LoggerFactory>();

            var serviceProvider      = services.BuildServiceProvider();
            var diagnosticObserver   = serviceProvider.GetService <DiagnosticAdapterProcessorObserver>();
            var diagnosticObserverMS = serviceProvider.GetService <DiagnosticProcessorObserver>();

            DiagnosticListener.AllListeners.Subscribe(diagnosticObserver);
            DiagnosticListener.AllListeners.Subscribe(diagnosticObserverMS);
            _listener       = new DiagnosticListener("Crash");
            _listenerMS     = new DiagnosticListener("CrashMS");
            _parm           = new CrashParams();
            _parm.Baz       = "svsdvsdvs";
            _parm.CallCount = "sdvsdvsd";
            _parmT          = new CrashParamsT();
            _parmT.bar      = _parm;
        }
Example #2
0
 public void OnBar(CrashParams baz)
 {
     CallCount++;
 }
Example #3
0
 public void OnFoo2([Property] CrashParams bar)
 {
     CallCount++;
 }
Example #4
0
 public void OnFoo([Object] CrashParams bar)
 {
     CallCount++;
 }
Example #5
0
 public void OnFoo(CrashParams bar)
 {
     CallCount++;
 }