public void Intercept(IInvocation invocation)
        {
            //protected override ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary<string, object> parameters)

            var controllerContext = (ControllerContext)invocation.Arguments[0];
            var actionDescriptor  = (ActionDescriptor)invocation.Arguments[1];

            var allFilters    = controllerContext.FiltersStore();
            var calledFilters = controllerContext.CallStore();

            var action = GlimpseFilterCallMetadata.ControllerAction(actionDescriptor, controllerContext.IsChildAction);

            allFilters.Add(action);

            var calledMetadata = new GlimpseFilterCalledMetadata {
                Guid = action.Guid
            };

            calledFilters.Add(calledMetadata);

            var watch = new Stopwatch();

            watch.Start();

            using (GlimpseTimer.Start("Action: " + actionDescriptor.ActionName, "Controller", controllerContext.Controller.GetType().Name))
            {
                invocation.Proceed();
            }

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
Пример #2
0
        public void Intercept(IInvocation invocation)
        {
            //protected override void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
            var controllerContext = (ControllerContext)invocation.Arguments[0];
            var actionResult      = (ActionResult)invocation.Arguments[1];

            var allFilters    = controllerContext.FiltersStore();
            var calledFilters = controllerContext.CallStore();

            var action = GlimpseFilterCallMetadata.ActionResult(actionResult, controllerContext.IsChildAction);

            allFilters.Add(action);

            var calledMetadata = new GlimpseFilterCalledMetadata {
                Guid = action.Guid
            };

            calledFilters.Add(calledMetadata);

            var watch = new Stopwatch();

            watch.Start();

            invocation.Proceed();

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
        public void Intercept(IInvocation invocation)
        {
            //protected override ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary<string, object> parameters)

            var controllerContext = (ControllerContext)invocation.Arguments[0];
            var actionDescriptor = (ActionDescriptor)invocation.Arguments[1];

            var allFilters = controllerContext.FiltersStore();
            var calledFilters = controllerContext.CallStore();

            var action = GlimpseFilterCallMetadata.ControllerAction(actionDescriptor, controllerContext.IsChildAction);
            allFilters.Add(action);

            var calledMetadata = new GlimpseFilterCalledMetadata { Guid = action.Guid};
            calledFilters.Add(calledMetadata);

            var watch = new Stopwatch();
            watch.Start();

            using (GlimpseTimer.Start("Action: " + actionDescriptor.ActionName, "Controller", controllerContext.Controller.GetType().Name))
            {
                invocation.Proceed();
            }

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
        public void Intercept(IInvocation invocation)
        {
            //protected override void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
            var controllerContext = (ControllerContext) invocation.Arguments[0];
            var actionResult = (ActionResult)invocation.Arguments[1];

            var allFilters = controllerContext.FiltersStore();
            var calledFilters = controllerContext.CallStore();

            var action = GlimpseFilterCallMetadata.ActionResult(actionResult, controllerContext.IsChildAction);
            allFilters.Add(action);

            var calledMetadata = new GlimpseFilterCalledMetadata { Guid = action.Guid};
            calledFilters.Add(calledMetadata);

            var watch = new Stopwatch();
            watch.Start();

            invocation.Proceed();

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
Пример #5
0
 public GlimpseFilterCalledMetadata LogCall(Guid guid)
 {
     var metadata = new GlimpseFilterCalledMetadata{Guid = guid};
     Store.Add(metadata);
     return metadata;
 }