public override IInterceptor CreateInterceptor(IProxyRequest request)
        {
            if (meterInterceptor == null)
            {
                MetricName metricName = Utils.BuildName(request, Name, Absolute);
                MetricRegistry registry = request.Context.Kernel.Get<MetricRegistry>();
                Meter meter = registry.Meter(metricName);
                Type t = typeof(Exception);
                if (ExceptionType!=null && ExceptionType.IsSubclassOf(t))
                    t = ExceptionType;
                meterInterceptor = new ExceptionMeteringInterceptor(meter, t);

            }


            return meterInterceptor;
        }
Exemple #2
0
        public override IInterceptor CreateInterceptor(IProxyRequest request)
        {
            if (meterInterceptor == null)
            {
                MetricName     metricName = Utils.BuildName(request, Name, Absolute);
                MetricRegistry registry   = request.Context.Kernel.Get <MetricRegistry>();
                Meter          meter      = registry.Meter(metricName);
                Type           t          = typeof(Exception);
                if (ExceptionType != null && ExceptionType.IsSubclassOf(t))
                {
                    t = ExceptionType;
                }
                meterInterceptor = new ExceptionMeteringInterceptor(meter, t);
            }


            return(meterInterceptor);
        }