コード例 #1
0
        protected override ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary <string, object> parameters)
        {
            var allFilters    = FiltersStore(controllerContext);
            var calledFilters = CallStore(controllerContext);

            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();

            var invokeActionMethod = base.InvokeActionMethod(controllerContext, actionDescriptor, parameters);

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;

            return(invokeActionMethod);
        }
コード例 #2
0
        protected override void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
        {
            var allFilters    = FiltersStore(controllerContext);
            var calledFilters = CallStore(controllerContext);

            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();

            base.InvokeActionResult(controllerContext, actionResult);

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
コード例 #3
0
        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();

            invocation.Proceed();

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
コード例 #4
0
ファイル: GlimpseFilter.cs プロジェクト: jeffsheldon/Glimpse
        public GlimpseFilterCalledMetadata LogCall(Guid guid)
        {
            var metadata = new GlimpseFilterCalledMetadata {
                Guid = guid
            };

            Store.Add(metadata);
            return(metadata);
        }
コード例 #5
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;
        }
コード例 #6
0
        protected override void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
        {
            var allFilters = FiltersStore(controllerContext);
            var calledFilters = CallStore(controllerContext);

            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();

            base.InvokeActionResult(controllerContext, actionResult);

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;
        }
コード例 #7
0
        protected override ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary<string, object> parameters)
        {
            var allFilters = FiltersStore(controllerContext);
            var calledFilters = CallStore(controllerContext);

            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();

            var invokeActionMethod = base.InvokeActionMethod(controllerContext, actionDescriptor, parameters);

            watch.Stop();

            calledMetadata.ExecutionTime = watch.Elapsed;

            return invokeActionMethod;
        }
コード例 #8
0
 public GlimpseFilterCalledMetadata LogCall(Guid guid)
 {
     var metadata = new GlimpseFilterCalledMetadata{Guid = guid};
     Store.Add(metadata);
     return metadata;
 }