Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

EventNotification support for MVC #2651

Closed
rynowak opened this issue Jun 4, 2015 · 7 comments
Closed

EventNotification support for MVC #2651

rynowak opened this issue Jun 4, 2015 · 7 comments

Comments

@rynowak
Copy link
Member

rynowak commented Jun 4, 2015

We want to add support for events via Microsoft.Framework.Notification to various components in MVC that can be consumed in process by diagnostic tools.

To start with we want to include data/events with known tooling experiences built around them. This isn't a complete list, but includes things we can start on.

Routing:

  • Each route should have an event for success/failure
  • Include HttpContext
  • Include information about the route being executed
  • Include RouteData

Action Selection:

  • Event for Actions Matching Route Values (include HttpContext, include RouteData, include ActionDescriptors)
  • Event for Actions Matching Constraints (include HttpContext, include RouteData, include ActionDescriptors)
  • Event for final action selected (include HttpContext, include RouteData)

Action Invoker:

  • Event for before/after a filter (include ActionContext, Filter, data from context Exception, Cancelled, etc)
  • Event for invoking action (include ActionContext, Controller, MethodInfo, Arguments)
  • Example: Logging: Filters #1629 (comment)

Model Binding:

  • Needs design - see: Logging: Model Binding #1566 (comment)
  • Goal here would be to include what data is bound to each model value/property and what data source it came from. This might require enhancing ValueProviderResult

Content-Negotation/ObjectResult:

  • Events for the content type chosen/conneg failed. Include inputs (Accept, Content-Type, Formatters, Model-Type, Result)

View Engine:

Startup:

  • Event for action discovery - include ActionDescriptors
@rynowak
Copy link
Member Author

rynowak commented Jun 4, 2015

/cc @avanderhoorn - this is where we're going to get started

@danroth27 danroth27 added this to the 6.0.0-beta6 milestone Jun 17, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta6, 6.0.0-beta7 Jul 1, 2015
@rynowak rynowak modified the milestones: 6.0.0-beta8, 6.0.0-beta7 Aug 16, 2015
@rynowak
Copy link
Member Author

rynowak commented Aug 17, 2015

Added some data points for:

Action Method begin/end
Action Result begin/end
View Found (ViewResult)
View Not Found (ViewResult)

This is all we're going to do here for beta-7 e384938

@pranavkm
Copy link
Contributor

@rynowak also brought this another use for this in a hallway discussion - we could use event notification instead of the interface contract we use for BrowserLink \ page instrumentation. This would require raising events for

  • View rendering - with details of view kind (partial \ full), path, and rendered view contents
  • Layout rendering
  • Templates?

Will need to speak to @jodavis to figure out the feasibility of doing this.

@avanderhoorn
Copy link
Member

For Microsoft.AspNet.Mvc.ViewResultViewFound, is it possible to get the location where it found the View?

Also is it possible to get a quick one line description of each event and what you should be using it to determine?

Here is a template that might make it faster to fill out if it helps?

  • BeforeAction - Microsoft.AspNet.Mvc.BeforeAction
    • Use when: ...
    • Can determine: What route was matched to a given Action
    • Provides access to: ActionDescriptor, HttpContext, RouteData
  • AfterAction - Microsoft.AspNet.Mvc.AfterAction
    • Use when: ...
    • Provides access to: ActionDescriptor, HttpContext
  • BeforeActionMethod - Microsoft.AspNet.Mvc.BeforeActionMethod
    • Use when: ...
    • Can determine: What objects (i.e. the finial model binding result) where passed into a given Action
    • Provides access to: ActionContext, ActionArguments
  • AfterActionMethod - Microsoft.AspNet.Mvc.AfterActionMethod
    • Use when: ...
    • Provides access to: ActionContext, ActionResult
  • ViewResultViewNotFound - Microsoft.AspNet.Mvc.ViewResultViewNotFound
    • Use when: ...
    • Can determine: The locations that the view engine searched for the view
    • Provides access to: ActionContext, Result, ViewName, SearchedLocations
  • ViewResultViewFound - Microsoft.AspNet.Mvc.ViewResultViewFound
    • Use when: ...
    • Can determine: The view data that is being passed to a given view
    • Provides access to: ActionContext, Result, ViewName, View

@rynowak
Copy link
Member Author

rynowak commented Aug 18, 2015

IView is passed to Microsoft.AspNet.Mvc.ViewResultViewFound and includes the view path.

@avanderhoorn
Copy link
Member

@rynowak Great!

@rynowak
Copy link
Member Author

rynowak commented Sep 22, 2015

We've done all planned work here for beta8. Any new requests will be tracked separately.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants