Well, its taken us awhile with everything going on, but we finally have support out for EF and those using “raw” ADO.
As usual, to get up and running simply go to Nuget and download the relevant package:
- Glimpse EF4.3 –
- Glimpse EF5 –
- Glimpse EF6 –
OR if you are just using ADO directly:
- Glimpse ADO –
If you just download the ADO package, but you are running Entity Framework you will have an exception raised. We have tried our best to make this not the case, but this is a limitation enforced on us by Entity Framework. So good rule of thumb, if you are using Entity Framework download the relevant EF package not just the ADO package.
Also, just because you have a Glimpse.MVC package installed doesn’t mean you automatically get these packages. You need to download the Glimpse.EF (or Glimpse.ADO) packages separately.
What we show
From within the plugin you can expect to see:
- Connections and how long each connection is opened for
- Commands associated with those Connections, number of records affected, how long the command took to execute and any errors that may have occured
- Transactions and which commands are associated with those Transactions and end status
As you might now, most of the EF’s infrastructure ends up leveraging ADO’s
DbProviderFactory infrastructure. As such, this is the where we tap in and from this, we get a fair amount for free (this what also happens to be how we get the build of our raw ADO support).
We also tap into the
DbConnectionFactory and in Entity Framework 6 we tap
DbProviderServices via the new
IDbDependencyResolver infrastructure the EF team has provided. With this I believe we catch the majority of use cases.
For those using Entity Framework or using
DbProviderFactory already you shouldn’t have to change any of your code.
If you happen to use EF in you App_Start, EF gets initialized before Glimpse has a chance to set up. In this case, you will need to include the following lines before your first query runs (an example of how this is used can be found here):
We need your help
Obviously it has taken a significant effort to get to this point. But in order to produce this release in a timely fashion we had to drop 2 main features:
- N+1 detection, and
- Execution context (i.e. indicating to the user where the query was triggered from)
We would love some help getting these features in. The first shouldn’t be that hard to implement, the second, might involve a bit more work.
Additionally, Entity Framework 6 has a bunch more information that would be great to expose:
- Registered Providers
- Model Mappings
- Manifest Details
Support for Entity Framework and ADO has been a long time coming. An initial prototype for these plugins was written around a year ago, but with everything going on, we never got it to a point where we felt comfortable producing a full release. But since going live with v1 and with some encouragement from K Scott Allen of OdeToCode fame, we have this release. Here is the list of people who helped make this release:
- K Scott Allen – Code review guru and Contributor
- Julie Lerman – Entity Framework goddess
- Glenn Condron – Entity Framework team
- Rowan Miller – Entity Framework team
- Steven Lauwers – Contributor
More details will be coming out soon and I will show some more interesting usage scenarios. In the meantime thanks for all your help and let us know what you think.
What else in 1.2
Trying to make sure that the rest of the release isn’t overshadowed by EF/ADO, here is the rest of what is in this release:
- Core: Fixed issue in timeline which affected sub 1 ms events.
- Core: Fixed trailing comma that causes problems with some browsers/browser modes.
- Core: Minor refactoring of MessageCategory classes.
- Core: Minor update to Nuget transform to show how to turn on logging.
- Core: Minor update to config page to make sure you always get latest logo.
- ASP.NET: Fixed issue where config tab would fail to show connection string for connection strings with no provider defined.
- MVC4: Major fix which adjusts the .NET version that Glimpse.MVC4 is running as (previously was .NET 4.5)
For the above, big shout out to the following people for the great bug reports:
For a full list of changes, issues and commits see below:
- Issues in this milestone – https://github.com/glimpse/glimpse/issues?milestone=4&state=closed
- Individual commits made in this milestone – https://github.com/glimpse/glimpse/compare/1.1.0…1.2.0