Exemple #1
0
        public AttributeTest()
        {
            _container = new WindsorContainer();

            _container.Register(Component.For <SimpleClass>()
                                .ImplementedBy <SimpleClass>().Interceptors <PerfItInterceptor>());

            _container.Register(Component.For <PerfItInterceptor>()
                                .UsingFactoryMethod((k, ctx) =>
            {
                var interceptor = new PerfItInterceptor("Vashah")
                {
                    PublishCounters    = false,
                    PublishEvent       = true,
                    RaisePublishErrors = true,
                    SamplingRate       = 1.0d
                };
                //interceptor.InstrumentorRequired +=
                //    (sender, e) => e.Instrumentor = new SimpleInstrumentorFixture(e.Info);
                return(interceptor);
            })
                                );

            _listener = new ObservableEventListener();
            _listener.EnableEvents(InstrumentationEventSource.Instance, EventLevel.Verbose);
            _subscription = _listener.LogToMemory();
        }
Exemple #2
0
        public AttributeTest()
        {
            _container = new WindsorContainer();
            _container.Register(
                Component.For <SimpleClass>().ImplementedBy <SimpleClass>()
                .Interceptors <PerfItInterceptor>());
            _container.Register(Component.For <PerfItInterceptor>().Instance(
                                    new PerfItInterceptor("Vashah")
            {
                PublishCounters    = false,
                PublishEvent       = true,
                RaisePublishErrors = true
            }));

            _listener = new ObservableEventListener();
            _listener.EnableEvents(InstrumentationEventSource.Instance, EventLevel.Verbose);
            _subscription = _listener.LogToMemory();
        }
Exemple #3
0
        public AttributeTest()
        {
            _container = new WindsorContainer();
            _container.Register(
                Component.For<SimpleClass>().ImplementedBy<SimpleClass>()
                    .Interceptors<PerfItInterceptor>());
            _container.Register(Component.For<PerfItInterceptor>().Instance(
                new PerfItInterceptor("Vashah")
                {
                    PublishCounters = false,
                    PublishEvent = true,
                    RaisePublishErrors = true
                }));

            _listener = new ObservableEventListener();
            _listener.EnableEvents(InstrumentationEventSource.Instance, EventLevel.Verbose);
            _subscription = _listener.LogToMemory();
        }