Author Archives: Anthony van der Hoorn

About Anthony van der Hoorn

Web/OSS Dev, Microsoft MVP/ASPInsider, Speaker and Co-founder of Glimpse. Work for Red Gate.

Glimpse 1.8.4 released

Another month has gone by since our last release and this time round its a smallish one. Mostly bug fixes and a couple of usefully additions, but most of our time lately has been focused on v2.

By way of a small update on v2, we have almost finished the work we want to do on the backend and starting to look at the UI of v2. If you are interested in seeing exactly where things are at or seeing where you can get involved, feel free to take a look.

Getting back to the release, here is what we have this time around:
Release Notes

  • Glimpse.Core – Featherweight release 1.8.4
    • Fix up edge case where UI would not be resizable
    • Extending the ContentTypeElement to include optional RuntimePolicy
  • Glimpse.ASP.NET – Bantamweight release 1.8.1
    • Update to RouteInspector to ignore non AspNet routes doesn’t work for WebHosted WebAPIs
  • Glimpse.EF* – Bantamweight release 1.6.1
    • Fixed bug when using DbGeography type in some edge cases

Special Thanks
In terms of pull requests, I have to say a big thanks to:

  • Paul Atkins
    • #736 The update to RouteInspector to ignore non AspNet routes doesn’t work for WebHosted WebAPIs
  • Björn Holdt
    • #746 Migrate Build to use Automatic Package Restore
  • James Chambers
    • Update to contributing documentation

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!

Glimpse 1.8.3 released – Insights removed

Today we had an unscheduled release of Glimpse. This was to remove the Insights “feature” which was introduced in the last release – 1.8.2. Its removal is based on the feedback we received from the community since going live.

Background
For a long time now, we have been trying to work on ways to get better feedback about how people use Glimpse. We routinely hear from people on Twitter, via the issue list and at conferences, unfortunately, this feedback is fairly anecdotal and hard to quantify. We decided to try and get usage analytics directly from the client itself.

In thinking about this, we decided to ask the community what they thought. Before we release 1.8.2, we posted our thoughts on this blog – Getting greater insights into Glimpse – and out on Twitter, asking for feedback, and received no negative response.

This morning, we received feedback from the community that the Insights feature isn’t desired (at least in its current form) and until we can make a decision as a community, we have removed the feature and released this update.

Moving Forward
From this experience, its clear that the communication channels that we have, and the process of lazy consensus, can’t adequately cover all situations. In addition, for changes such as this, we should work much harder to get/force a response from the community before moving forward.

I’m happy that the we where able to respond to community feedback quickly and hope that we can continue to do so in the future.

Thanks to those who participated in the discussion and I’m glad we came to a good outcome.

Glimpse 1.8.2 released

Its a new year and we have a new release ready to go out the door. This time around, we have a ton of bug fixes and a few new features here and there. This release represents the most contributions Glimpse has ever had in a single release, as well as having the greatest number of contributors.

WebForm support for DataBinding
Since our initial support for WebForms was released, the response from the community has been amazing. Not only have we discovered that WebForms developers have been seeking innovations in the space, but have been wanting to get involved. This has lead to Graham Mendick and Steve Ognibene stepping forward to make sure the WebForms package keeps moving forward.

This has lead to DataBinding visualization being added to the Control Tree tab within Glimpse. More details will com in a future blog post, but the short version is that we can now see all the actions that WebForms takes to bind your controls.
WebForms_DataBinding

ASP.NET Server tab
In a previous release, we removed the old version of the Server tab. This was removed as a lot of the data we where displaying was being shown elsewhere. Since then, we have found that some users missed the data that wasn’t being displayed elsewhere. Hence, the Server tab has made a come back and has received a bit of a facelift thanks to Bryan Hogan.
ServerTab

Glimpse Insights support
Along with this release, we are putting out Glimpse Insights. As discussed in the post, this is the means by which we hope to better understand how people use Glimpse and where we should be focusing out efforts.

As much as we need these insights to make better decisions and ultimately a better product, if its something that you don’t want to take a part in, you can completely opt-out. Simply update the Glimpse section in your web.config to have the following addition:

    <clientScripts>
      <ignoredTypes>
        <add type="Glimpse.Core.ClientScript.Insight, Glimpse.Core"/> 
      </ignoredTypes>
    </clientScripts>

If you do opt-out, there will be no traces of Insights in your code base. Insights was designed not simply to be a switch on or off, but to be a complete removal. Meaning no traces of the Insights code will remain if you choose to opt out.

Release Notes

  • Glimpse.Core – Featherweight release 1.8.2
    • Update to disabled Glimpse when request init is bypassed
    • Update client to only modify local ajax requests
    • Add initial support for Glimpse.WindowsAzure and Glimpse.WindowsAzure.Storage
    • Update to show friendly message if current async implementation is not supported
    • Added initial Insights support to client
    • Update client to delayed tab rendering till glimpse open
    • Update client to added more blacklist items for target chars that should be ignored by case processor
  • Glimpse.ASP.NET – Welterweight release 1.8.0
    • Update Route Inspector to ignore non AspNet based routes (this fixes problems with Glimpse and WebAPI)
    • Added updated Server Tab which shows common server variables
    • Clean up web.config transform to remove volume of commented out config in the glimpse section
    • Update Request Tab serialization to handle request validation failures
  • Glimpse.MVC* – Flyweight release 1.5.3
    • Added updated support for IUnvalidated and IEnumerable ValueProviders
    • Fixed problem where Response.RedirectToRoute() in Global.asax could throw a NullReferenceException
  • Glimpse.WebForms – Lightweight release 1.1.0
    • Added visualization for DataBinding in the ControlTree Tab
    • Improve basic ViewState processing for SqlDataSource, LinqDataSource and ObjectDataSource

Special Thanks
In terms of pull requests, I have to say a big thanks to:

  • Christophe Gijbels
    • #704 Disabled Glimpse when request init is bypassed
    • #702 Update Request Tab serialization to handle validation failures
    • #701 Added update for IUnvalidated and IEnumerable ValueProviders
  • Keith Dahlby
    • #688 Show friendly message if current async implementation is not supported
  • Paul Atkins
    • #723 Update Route Inspector to ignore non AspNet based routes
  • Bryan Hogan
    • #712 Adding updated Server Tab which shows common server variables
  • Graham Mendick and Steve Ognibene
    • #716 Update WebForms Control Tab to visualize DataBinding

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!

Client side development just got easier

For those who are contributing to the client or writing client side plugins, things just got a little easier. Today we committed to master an update that adds a feature to the client test page which shows all the client pub/sub events that occur and who is subscribed.

The client has a loosely coupled architected based on top of a pub/sub model. Pub/sub has many advantages, but one of its biggest disadvantages is visibility into what events are occurring, the data being passed and who is subscribed. This tab reveals all of this information and more. It even updates live as events are occurring and as the client lifecycle moves on.

Here is a preview of what you can expect:
PubSubTab

At the moment, this tab is currently only available in the client test page. In the future, we are looking at the possibility of shipping this within the server implementation and allow developers to toggle it on and off as required. But this will be done some time in the future based on feedback.

Getting greater insights into Glimpse

It’s the start of another year for Glimpse, and like last year, we are gearing up for more big things. In the first half of the year, we are expecting to get version two out the door – plus more support for new frameworks and platforms.

In 2013, Glimpse version one shipped in February, and since then it’s been a roller-coaster ride of support for additional frameworks (ADO.NET, EF, ASP.NET MVC4, MVC5 and WebForms), great new new features and a design overhaul. In addition we’ve been keeping up with new paradigms and rethinking established ones (support for async, and the new visualizations of WebForms information released in October and November). Some amazing work has gone into all this, and while there are a few names that do stand out (we brought on two new full time contributors Christophe Gijbels and Björn Holdt), it’s all down to you guys – so thank you, and we hope you had very Happy Holidays!

With the start of 2014, we are focusing on how we get you the information you need to better understand your application. Most of this boils down to what we are currently calling “context aware UI”. This is based on a realization that we are currently siloing information that can better be represented when shown together, in a unified view.

Currently, this is happening in HUD and the various popup views. Here, we merge together information from the several tabs (such as the execution and SQL tabs), to build a unified picture. But we want to carry this vision beyond just HUD and forward into the main Glimpse UI. Exactly what form this will take, we aren’t sure yet, but it’s something that we are actively working towards.

To this end, we want to better understand how people use and interact with Glimpse. With this information, we feel we can better make the decisions on how to move forward and what impact potential changes will have. To help in doing this, we feel the most effective tool we can introduce is system analytics.

In the past, we’ve made all Glimpse improvement decisions based on anecdotal evidence that hear in the the issues list/forum and by chatting with users at conferences. While this information has been enlightening and hugely helpful, we’re never been able to be quite certain whether we’re helping the majority of you, or just those of you who are active in voicing your opinions.

Removing the Server tab is a great example of where we might not have made the best decision that we could have. We made the change based on feedback from users who said that they didn’t use it. Once it was done, we had a large number of users come back saying that they regularly use this tab. We had no idea these users existed or used Glimpse in the way that they do.

To remedy this, we’d like to introduce metrics into Glimpse to allow us to more fully understand usage, what tabs are being used and what mostly gets thrown by the wayside. This will help us to create a Glimpse that works best for you, based on what you want and need, rather than what we think might be useful. This, we hope, will help us move forward and take Glimpse to the next level.

Being the type of project we are, we will be fully transparent with our findings and what the data is revealing to us. We expect that the metrics will flow through to our site, but we haven’t worked out the exact technical details yet. Additionally, like any similar effort, if for what ever reason you don’t want to participate in providing anonymous usage data, we will provide a simple means to completely opt-out. Lastly, it is intended that none of this effort will impact the runtime or execution of your application which we deem as a key criteria for success.

Like always we would love your feedback and ideas. If anyone is interested in helping out with the dev effort, let us know, as there are several technical challenges that are going to be interesting to work through.

Glimpse 1.8.0 released – Async Support

In an effort not to leave too much time between releases, we happy to announce that as of today, Glimpse now supports capturing details that occur within Async operations. With the advent of .NET 4.5 it is easier than ever to take advantage of Async tasks to perform out-of-process or long running tasks.

Before now, Glimpse hasn’t been able to see the details of what occurs within these tasks, but with the help of the community, now we can! Unless you have specific needs, chances are the biggest difference you will see in your day-to-day usage of Glimpse, is that we can see everything that happens in Async queries that ADO/EF perform.

Release Notes

  • Glimpse.Core – Welterweight release 1.8.0
    • Support for capturing data on Async operations
    • Added Status Code to ajax and history tabs
    • Client now sensibly interpret friendly titles out of object keys
    • Client updated to render array lists as array of objects rather than array of arrays
    • Fixed bug where timeline couldn’t cope with long strings as the event title
  • Glimpse.ASP.NET – Welterweight release 1.6.0
    • Total rewrite of the Request tab to include additional request info
    • Removed Server tab as it’s now obsolete given the Request tab update
  • Glimpse.MVC* – Featherweight release 1.5.1
    • Fix version number inconsistency between MVC packages
    • Fix version information in MVC5
  • Glimpse.WebForms – Featherweight release 1.0.2
    • Greater support for many more control ViewState’s
    • Fixed circular reference bug that could be caused by some controls ViewState
    • Fixed bug which could cause trace output to be rendered in the page
  • Glimpse.ADO – Welterweight release 1.7.0
    • Support for Async queries
    • Added async indicator column to the SQL tab
    • Minor adjustment to the width of the transaction title column in SQL tab
  • Glimpse.EF* – Welterweight release 1.6.0
    • Support for Async queries
    • Added async indicator column to the SQL tab

Special Thanks
In terms of pull requests, I have to say a big thanks to:

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!

Glimpse 1.7.0 released – First class WebForms support & MVC5

Its been a while, but we have been hard at work version 2.0 (more on that later) and producing some new packages – which we are releasing TODAY! These new packages represent the first new packages we have released since Entity Framework support went out the door in March and I think you are in for a real treat.

We have released two new packages today and a bunch of other minor features/fixes. Here are the highlights:

  • Glimpse.WebForms Released:
    • Amazing ViewState support
    • New Control Tree and Page Life Cycle Tabs
    • Deep HUD integration
  • Glimpse.MVC5 Released:
    • All the tabs you previously had with MVC4
    • Support for attribute driven routes

WebForms support

Glimpse.WebForms is a revolutionary step forward in the way we will work with WebForms in the future. For years, many have struggled to understand how WebForms works, what is responsible for ViewState bloat or if you even have a ViewState issue. As of today, we finally have the tools we need to know exactly how WebForms is running and what is responsible for problems we may be experiencing.

ViewState Reimagined
We have taken a crack at totally re-imagining what we have come to expect when working with ViewState.
ViewStatePreview

As you can see, without any ceremony, Glimpse shows you all of your controls and the ViewState that each control has generated. This is insight, that until now, we have only been able to dream about.

Current Pain:
For most, understanding/controlling ViewState has always been a struggle. When we think about ViewState, most think about a hidden input in our HTML that contains a blob of text which does something for our site.

ViewStateRaw

Mostly, when its running smoothly, ViewState isn’t one of those concerns that we think about every day. But at some point, we discover that amount of data being sent down to the page in ViewState growing out of control – ViewState bloat.

Solution Seeking:
When this occurs we typically turn to Google, which brings up a trusty StackOverflow article that will give us the answer of where to start – Seeking advice on de-bloating asp.net 3.5. Unfortunately though, the top answer is to:

“Try ASP.NET MVC or one of the other MVC web frameworks for .NET”

For most this is a very unhelpful and disappointing answer. Not everyone has the “luxury” to rewrite their whole site just to solve this one problem.

ViewState De-coders:
So, after some more searching we discover that there is a way of taking the ViewState text and running it through a de-coder:
ViewStateDecoded
At first glance, we think we are getting somewhere, but we soon discover that we have no idea what the data means or what control is responsible for generating it. Note: all this assumes that we aren’t running out WebForms site in .NET 4.5, as ViewState is now encrypted. Hence, making the only tools we had useless.

Enter Glimpse!
Glimpse is in a unique position to try and solve many of the problems we have around ViewState. Since we run on the server, we are able to see the ViewState before it is encrypted and we are even able to determine which server control generated the state.

Here is a specific example of what Glimpse is able to bring to the table:

Here is a specific example of what Glimpse is able to bring to the table

1) Master Page State,   2) Cart Count State   and   3) List View State

vs.
1) Master Page State

1) Master Page State

2) Cart Count State

2) Cart Count State

3) List View State

3) List View State

Strongly Typed ViewState:
When looking at the above screen shots of Glimpse, its easy to miss the way in which we display the data. As it turns out the ViewState object model is designed for the systems to process (not humans) and is optimised for minimum payload size. Hence, if we don’t perform any additional logic, the below is what you would see:

"Untyped ViewState data"

“Untyped ViewState data”

When looking at this, you’d be easily forgiven for finding it better than what a decoder provides (since we know what ViewState belongs to what controls), but it still doesn’t match our mental model of what we think the data should look like.

Hence, we decided to take a crack at making that better too. We discovered that since we know which server control generated the ViewState, we are able to present the data in a format that “strongly types” it on a control by control basis. This technique changes the output we can show you dramatically. Resulting in the below:
ViewStateTyped

No more guessing:
With the advent of this capability, you will no longer have to guess what controls generated which ViewState data. Glimpse makes this completely transparent and understandable to everyone.

Control Tree
As you would have guessed by looking at the above screenshots, we are able to present you the Control Tree Hierarchy as well. This structure is used by the WebForms framework to generate the HTML that you see on your page. This may look familiar from the Trace.axd days, but as discussed above, Glimpse has taken it up a notch.

Here is a list of what we show you out of the box:

  • Control Id: This is the server-side ID that is generated by the framework for your control. If you specifically set an ID, then the system will display that name instead.
  • Type: The system Type of the rendered control.
  • Render (w/ children): The size in bytes of the HTML generated by the control and its children.
  • ViewState: The size in bytes of the ViewState generated directly by the control.
  • ControlState: The size in bytes of the ControlState generated directly by the control.

Page Life Cycle
In sites using WebForms, the page life cycle is a series of events which fire on every page and has a very defined sequence. As fate would have it, its one of those things that we rarely remember exactly how and when they are supposed to execute. Glimpse makes this transparent by showing you which events occurred, their timings and offsets.

Here is what we show you out of the box:
PafeLifeCycle

Trace Tab:
Beyond showing these events in the Page Life Cycle tab, we automatically trace out the Begin and End notifications for each event to the Trace Tab. This means that when ever you write out data via either of the following methods, it will show up between the relevant Page Life Cycle trace messages:
System.Diagnostics.Trace.Write("This is a trace Message");
or
System.Web.HttpContext.Current.Trace.Write("This is another trace Message");

With that, here is the final result:
PageLifeCycleTrace

Timeline Tab:
Besides just adding this data to the Trace tab, we have included the events within the timeline tab. This means that when you have other timing events (like database access) occurring, you will be able to visual see exactly what is happening.
WebFormsTimeline

WebForms in HUD
If all this wasn’t enough, we decided to make sure the most important ViewState and Page Life Cycle data be shown within HUD (heads up display).
WebFormsHUD

HUD is specifically designed to stay at the bottom of every page and stick with you as you go about your normal development effort. Taking this into account we show you the following out of the box, without having to click, mouseover or select anything:

  • Load: Time between Begin PreLoad and End LoadComplete.
  • Render: Time between Begin PreRender and End Render (including SaveState events).
  • ViewState: Total size in bytes that the page has stored as ViewState.

If you are used to the Glimpse.MVC packages, the Load and Render times are similar to the Action and View times that we show you. But for those who use ViewState, knowing exactly what each page is generating within HUD is huge. This one figure alone is invaluable, let alone the rest of what this package brings.

HUD popup view
HUD also allows us to show a more detailed view of the most important information we have in the form a popup that appears when you mouse over a section. For WebForms, we have taken advantage of this to show a contextual view of the Page Life Cycle information along with any database activity you may have performed.

WebFormsHUDPopup

Beyond seeing what we saw in the mini view, we have added the Page Life Cycle events and included exactly different database events have occurred. This allows you to see straight away what events are taking the longest and what queries are occurring where. Prior to Glimpse.Webforms, building this picture was virtual impossible.

MVC5 support

The other package we are releasing today is Glimpse.MVC5. This is an incremental release for MVC and designed to match the latest release of ASP.NET MVC. With this release, you will get all the usual goodness you have come to expect from Glimpse.MVC*. The release also contains support for the new attribute driven routing that MVC5 brings to the table.

Attribute Drive Routing

Attribute Drive Routing

Glimpse Route Tab

Glimpse Route Tab

Release Notes

Beyond everything I have already covered in the above, this release includes a number of updates and fixes for a variety of issues. This release contains updates to following packages:

  • Glimpse.Core – Welterweight release 1.7.0
    • Improvement which allows Glimpse.axd to be protected by custom security policies
    • Fix History tab causing issues when invalid characters are present in a Session Name
    • Performance improvement Ensure client shell is forced into a new rendering layer within browser
    • Update Visual Studio solution to VS2013
    • Improvement to client which adds support for paddings when rendering structured layouts
    • Improvement to client to make array rendering more resilient
    • Improvement to client which ensures table headers have the correct default style applied
    • Improvement to client which brings better error management in master rendering engine
    • Switch assemblies to be marked as CLS-compliant
    • Switch Glimpse.axd over to use templates for generating the configuration resource
    • Ensure that Glimpse ignores BrowserLink’s preflight requests
    • Make sure HUD only displays Ajax requests that have a Glimpse Payload
  • Glimpse.AspNet – Welterweight release 1.5.0
    • Fix bug which caused the writing of log data during AppDomain unloading not to appear
    • Fix bug which meant that in some cases the end body tag couldn’t be located
    • Switch assemblies to be marked as CLS-compliant
  • Glimpse.MVC* – Middleweight release 1.5.0
    • Implemented support for MVC5
    • Switch assemblies to be marked as CLS-compliant
  • Glimpse.WebForms – Heavyweight release 1.0.0
    • Advent of the Control Tree and Page Life Cycle tabs
    • WebForms data now shows up in HUD (including ViewState size), in Timeline Tab and Trace Tab
  • Glimpse.Ado – Flyweight release 1.6.0
    • Improved SQL Tab layout so that the overall stats are displayed at the tab
    • Switch assemblies to be marked as CLS-compliant
  • Glimpse.Ef* – Bantamweight release 1.5.0
    • Switch assemblies to be marked as CLS-compliant

In terms of pull requests, I have to say a big thanks to:

  • Christophe Gijbels
    • #586 Securing default configuration resource
    • #563 Changed in-code html generation to template approach for configuration resource
    • #555 Fixed PreBodyTagFilter partial writes handling
  • Kelly Stuard
    • #565 Making Glimpse CLS-compliant.
    • #564 Fix race condition between message bus and subscribers
  • Jeff Burn
    • #580 Fix HUD for WebForms with no viewstate

And for the great issue reports, I want to thank:

We also had a few users who really hammered on early builds of the WebForms package to ensure that it would work well for the whole community. Thanks a million to:

Well I think that is a wrap. For a full list of changes, issues and commits see below:

Let us know if you have any thoughts or comments and I hope you enjoy this release.

Glimpse 1.6.1 released

Release 1.6.0 has been out for a little over a month now and so far so good. Generally speaking, our stability over the past few months has been pretty good and as a result we are starting to feel that Glimpse v1 is nearing an end and v2 is on the horizon! but more to come on that in the future :D

In the mean time we noticed that the issue backlog has been building up and wanted to go on a bug bashing excises. Hence, we have been spending time knocking down out issues. We managed to get out outstanding issue count down from around 110 to under 40. As you might imagine, this has resulted in some updates and hence this release.

Hence, this release is a service update to fix a variety of issues. This release sees updates to following packages:

  • Glimpse.Core – Welterweight release 1.6.1
    • Switch images on Glimpse.axd page to their DataUri representations to avoid mixed content requests
    • Switch href over from using “#” to “javascript:void(0)”
    • Remove trailing commas in client
    • Switch logo on the About tab over to the new logo
    • Removed IpAddress as its not used anywhere
  • Glimpse.AspNet – Lightweight release 1.4.1
    • Removed IpAddress as its not used anywhere
    • Fixed possible null refernce exception when access clientId
    • Removed unused AspNet.Net35 Net35Backport
  • Glimpse.Ado – Flyweight release 1.5.1
    • Switched GlimpseDbTransaction over to be public
  • Glimpse.Ef* – Middleweight release 1.4.0
    • Added groundwork support for EF6

In terms of pull requests, I have to say a big thanks to:

And for the great issue reports, I want to thank:

Well I think that is a wrap. For a full list of changes, issues and commits see below:

Let us know if you have any thoughts or comments and I hope you enjoy this release.

Glimpse 1.6.0 released

Since our last release a fair bit of time has passed. Most of this has been taken up with speaking at MonkeySpace (expect a post on this in the future) and trying to take a good swat at knocking off a few key bugs that have been building up. That said we did manage to squeeze in a few useful new features.

Server Timing
We got a few requests come through to show the time on the server. This is useful for tracking down inconstancies in the time between the client and server or delta between the server and a trusted time source (some public NTP source for example). Time can also become important when dealing with things such as encryption / authentication, or when server has issues with wrong DST settings.

Here is a screenshot of what to expect:
TimeZoneDetails
This shows shows full server time, if DLS is in effect and delta between client and server time.

Environment Tab
We have also made some updates to the Environment Tab to show more version information. The thought process is that with Nuget packages that are starting to use the full SemVer spec (specifically pre-release and build metadata) just showing the standard version isn’t enough any more. Packages like EntityFramework have the same 6.0.0.0 version number during the whole pre-release cycle, but have different package versions. Hence now, we show the full version number that is used in Nuget if its available.

This is what the new details look like:
EnvironmentTab

This is useful when you want to confirm that the correct version of a package installed.

Release Notes

  • Glimpse.Core – Welterweight release 1.6.0
    • Add server “clock” time to HUD (shows full server time, if DLS is in effect and difference between client and server time)
    • Update to client to pulse tabs to try and show that the state context has changed
    • Update to client to show a loading message (instead of an error message) to give the data a chance to load
    • Update to client for Principal vs. Principle
    • Update to client to support object values having layouts
    • Fix bug where JSON.NET could screw up self reference loops
    • Fix small typo in update notification on glimpse.axd
  • Glimpse.ASP.NET – Middleweight release 1.4.0
    • Add server “clock” time to HUD (shows full server time, if DLS is in effect and difference between client and server time)
    • Update Environment tab update to show more version Info
    • Fixed issue where tabs could randomly disappear in some cases
    • Fixed issue where calls to HttpContext.Request in IIS7 Integrated mode threw exceptions
    • Fixed issue where query string parameters with a null key would throw an exception
    • Fixed issue to make Glimpse NuGet package discovery more stable
    • Update to make the injection of the the script tags into the rendered pages more robust
    • Update Environment tab to make it more realilant to exceptions in different protection modes
    • Update to make it easier to get Glimpse working when using dynamic compression
  • Glimpse.MVC* – Featherweight release 1.3.3
    • Minor adjustment to bring NuGetPackage inline with eachother
  • Glimpse.ADO – Lightweight release 1.5.0
    • Add support for profiling DbDataAdapter.Fill() correctly

Special Thanks
In terms of pull requests, I have to say a big thanks to:

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Side Note
We currently know there is an issue with our EF6 package being broken with EF6 Beta1. We hope to have this fixed soon.

Parting words
Let us know if you have any thoughts or comments and I hope you enjoy this release.

Extending your Tab – Your code, your plugins, part 3

So far we have covered a couple of different cases around how you could introduce custom Tabs into your system to gain a better understanding of how your system is operating (Creating a simple Tab – Your code, your plugins, part 1 and Creating a typical Tab – Your code, your plugins, part 2).

These tabs have been great to get up and running, but there is a chance that after a while, you may want to get more from your tab. Specifically, to extend its look and feel, and even to enhance the data that you are seeing inside the plugin.

New Concepts

  • Controlling the layout of your tab
  • Render compound/nested objects
  • Pivoting the root table layout

Use Case 3: Show the content of a shopping cart style component you might have written, using a custom layout

This time around, it’s the same use case that we saw in part 2 but we are adding on the fact that we would like to control the layout. We want to augment what we see so the layout is clear and the data representation matches our mental model, not just the object structure we happen to be dealing with. We want to control the headers/titles, order of the columns, prefixes/postfixes, styling, etc.

Existing code
I’m going to assume that you have seen how we got the base plugin up and running (if you haven’t, checkout part 2). The code in question is that of a typical Tab that returns an object collection.

public class TabCart : AspNetTab
{
    public override string Name
    {
        get { return "Cart"; }
    }

    public override object GetData(ITabContext context)
    {
        var cart = ShoppingCart.GetCart(context.GetHttpContext());
        var items = cart.GetCartDetials();

        return items;
    }

    public override RuntimeEvent ExecuteOn
    {
        get { return RuntimeEvent.EndSessionAccess; }
    }
}

Controlling the layout of your tab
Problem
By default when we return data from our ITab.GetData() method, the object contains no styling information. The rendering engine gets us pretty close to what we want to see but still doesn’t get us all the way there.

Solution
As it turns out Glimpse supports an extension model which favours Interface Segregation. This is just a fancy way of saying that extra functionality can be added to a Tab by making a Tab implement a given interface. This interface will augment the Tab and allow it to perform functions that a base Tab would would otherwise not be able to.

This is what we would like to see:
LayoutTab
You will note that it looks similar to the previous version of the tab we had, but its layout is different.

Sample Code
In this case we are going to add on the ITabLayout interface which requires that we add on a GetLayout() method. This method should return an object which describes how the data is to be structured or laid out. To help controlling these layouts we have a fluent API (which was created by Kristoffer Ahl of Fluent Security fame). The following gives you a basic taste of what you could do to achieve the above:

using Glimpse.AspNet.Extensibility; 
using Glimpse.AspNet.Extensions;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Tab.Assist;
using MvcMusicStore.Models;

namespace MvcMusicStore.Framework
{
    public class TabCart : AspNetTab, ITabLayout
    {
        //NEW CODE
        private static readonly object Layout = TabLayout.Create()
                .Row(r =>
                {
                    r.Cell("{{albumTitle}} ({{albumId}})").AsKey().WithTitle("Album (Id)");
                    r.Cell("albumPrice").AlignRight().Prefix("$").WidthInPixels(100).WithTitle("Price");
                    r.Cell("genreName").WithTitle("Genre");
                    r.Cell("artistName").WithTitle("Artist");
                    r.Cell("count").Class("mono").WidthInPixels(70).WithTitle("Count");
                    r.Cell("dateCreated").WithTitle("Added");
                    r.Cell("recordId").WithTitle("Record Id");
                    r.Cell("cartId").WithTitle("Cart Id"); 
                }).Build();
        //NEW CODE
         
        public override string Name
        {
            get { return "Cart"; }
        }

        public override object GetData(ITabContext context)
        {
            var cart = ShoppingCart.GetCart(context.GetHttpContext());
            var items = cart.GetCartDetials();

            return items;
        }

        public override RuntimeEvent ExecuteOn
        {
            get { return RuntimeEvent.EndSessionAccess; }
        }

        //NEW CODE
        public object GetLayout()
        {
            return Layout;
        }
        //NEW CODE
    }
}

Render compound/nested objects
Problem
Having seen what the above has produced and the fact that we are starting to gain a real insight into how our shopping cart is operating, we have decided that we want to take things to a whole new level. We don’t want to repeat the shopping cart ID for every row (as we only want to see it once) and we want to see other aggregated information about out cart inside the tab (i.e. total value, etc).

Solution
As it turns out, Glimpse is capable of being able to render nested objects. When it detects a property which is a complex vs. primitive type, it recursively rips through that object and starts the rendering process again. For us, this means that we could construct an object that has the data we want listed above the table of cart entries.

Here is the next iteration of what we would like to see:
SummaryCartTab

Sample Code
Knowing that we want to show some more data, we can go back to the Tab and make some tweaks. Looking at the below, we can see that we have extended the model that we are returning and have added some more details to the meta data that’s returned.

public class TabCart : AspNetTab, ITabLayout
{
    //UPDATED CODE
    private static readonly object Layout = TabLayout.Create()
            .Cell("items", TabLayout.Create().Row(r =>
                {
                    r.Cell("{{albumTitle}} ({{albumId}})").AsKey().WithTitle("Album (Id)");
                    r.Cell("albumPrice").AlignRight().Prefix("$").WidthInPixels(100).WithTitle("Price");
                    r.Cell("genreName").WithTitle("Genre");
                    r.Cell("artistName").WithTitle("Artist");
                    r.Cell("count").Class("mono").WidthInPixels(70).WithTitle("Count");
                    r.Cell("dateCreated").WithTitle("Added");
                    r.Cell("recordId").WithTitle("Record Id");
                })).Build();
    //UPDATED CODE
     
    public override string Name
    {
        get { return "Cart"; }
    }

    public override object GetData(ITabContext context)
    {
        var httpContext = context.GetHttpContext();

        var cart = ShoppingCart.GetCart(httpContext);
        var items = cart.GetCartDetials();

        //UPDATED CODE
        var root = new
        {
            CartId = ShoppingCart.GetCartId(httpContext), 
            Total = items.Any() ? items.Sum(x => x.AlbumPrice).ToString() : "--", 
            Items = items
        };
        //UPDATED CODE

        return root;
    }

    public override RuntimeEvent ExecuteOn
    {
        get { return RuntimeEvent.EndSessionAccess; }
    }

    public object GetLayout()
    {
        return Layout;
    }
}

Pivoting the root table layout
Problem
As fate would have it, the above still isn’t good enough. We like the fact that the layout has progressed forward but, having seen other Tabs within Glimpse that are displayed more succinctly, we want to do more. In addition, the above rendering kinda squashes the Items table.

Solution
Another nice feature that the Glimpse rendering engine supports is the ability to pivot the way in which key/value Objects are displayed. When you do this, instead of seeing a key and value column, headings are rendered for the keys and the values are rendered in block under the corresponding header.

This time around, the below is what we would like to see:
PivotLayoutTab

Sample Code
Knowing that Glimpse can deal with nested objects and that we have the ability to pivot, we are going to group together the summary details. You will note that the pivot functionality is added by having our Tab implement the ILayoutControl interface. This is another example where we are using Interface Segregation to add functionality.

using System.Linq;
using Glimpse.AspNet.Extensibility; 
using Glimpse.AspNet.Extensions;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Tab.Assist;
using MvcMusicStore.Models;

namespace MvcMusicStore.Framework
{
    public class TabCart : AspNetTab, ITabLayout, ILayoutControl
    {
        private static readonly object Layout = TabLayout.Create()
                .Cell("items", TabLayout.Create().Row(r =>
                    {
                        r.Cell("{{albumTitle}} ({{albumId}})").AsKey().WithTitle("Album (Id)");
                        r.Cell("albumPrice").AlignRight().Prefix("$").WidthInPixels(100).WithTitle("Price");
                        r.Cell("genreName").WithTitle("Genre");
                        r.Cell("artistName").WithTitle("Artist");
                        r.Cell("count").Class("mono").WidthInPixels(70).WithTitle("Count");
                        r.Cell("dateCreated").WithTitle("Added");
                        r.Cell("recordId").WithTitle("Record Id");
                    })).Build();
         
        public override string Name
        {
            get { return "Cart"; }
        }

        //NEW CODE
        public bool KeysHeadings
        {
            get { return true; }
        }
        //NEW CODE

        public override object GetData(ITabContext context)
        {
            var httpContext = context.GetHttpContext();

            var cart = ShoppingCart.GetCart(httpContext);
            var items = cart.GetCartDetials();

            var root = new
            {
                //UPDATED CODE
                Details = new {
                        CartId = ShoppingCart.GetCartId(httpContext), 
                        Total = items.Any() ? items.Sum(x => x.AlbumPrice).ToString() : "--"
                    },
                //UPDATED CODE
                Items = items
            };

            return root;
        }

        public override RuntimeEvent ExecuteOn
        {
            get { return RuntimeEvent.EndSessionAccess; }
        }

        public object GetLayout()
        {
            return Layout;
        }
    }
}

Working Sample
If you want to run what we have in the first sample, here is the link (94e9f99eda), or for the modified Tab, here is the link (e1fb2ca944), or for the finial pivoted Tab (e6d5eb04b2). As usual feel free to play around with it and modify.