Thursday, September 19, 2013

Glimpse - Firebug for Server

Glimpse is a browser based monitoring/analysis tool for your server side code. If you have used firebug (Firefox), Google chrome dev tools or F12 in IE you will feel right at home using Glimpse. After SignalR, this is the coolest piece of technology I’ve come across in Microsoft web development space.

Glimpse comprise of a server and a client component. Server component collects server information and sends it as json to the client component which renders it. One of the beauties about Glimpse is its extensibility. The developers (Anthony & Nick) have done a great job of keeping both server and client side as extensible as possible. Currently server supports ASP.Net MVC and WebForms (They are working on WebApi and OWIN) while the client supports any modern browser (yeah...not you IE < 8).

What I want to note today, is not why it’s absolutely necessary for a Microsoft web developer to be aware of Glimpse, but pick a few properties of Glimpse project as pointers to a successful open source project. There seem to be a number of successful open source projects on .Net (specially in the web domain) based technologies and Glimpse is a classic example. I will note down a few properties that I felt contributed to the success of Glimpse (Beside the cool way it’s solving a real problem)

Architecture that invites extension

Getting people to use your product is the best way of promoting it. A very close second runner is getting developers to extend it. Developer engagement enhances the application and expands it reachability, sometimes going into areas that you initially never thought it will.

Capability to write your own policies (controls Glimpse), extensions (adds capabilities), Tabs (adds client views) and persistence models (default persistence is in memory with a limited size queue) really has accelerated the growth of Glimpse. These are facilitated by well thought out design of features and interfaces. I think extensibility should not be an afterthought but one prime goal in any open source project with considerable potential reach.

Code that’s easy to comprehend

Although Glimpse documentation is still work in progress, that hasn’t stopped developers from getting engaged. The code is on GitHub public repository and anyone can read/contribute. However it should be noted that the code does not act as a barrier to understand the design of the solution. It’s quite easy to read and understand what’s going on without a lot of documentation.

Easy to integrate - Easier to upgrade

I got one word for this - NuGet. No .Net open source project can ignore NuGet support. NuGet brings ease and consistency to the whole dependency management business. It has done away with the configuration mess that we .net developers used to have and the upgrade is seamless. Glimpse has gone the extra mile here where they show you a ‘New version available’ link in the client UI as and when new versions get released. All you have to do is perform an ‘Update-Package’ in NuGet package explorer in VS.

Convention over configuration

Another reason for user/developer delightness with Glimpse is their preference of convention of configuration. There’s very little configuration considering the extensibility of the product. All of the extensions are interface based and automatically discovered and bound during run time getting rid of a lot of potential configurations. This of course enhances the buy-in a great deal.

Even the tabs (the UI components which shows information) are developed with convention in mind where your typical json data structures are automatically rendered using grids. Without writing a single piece of UI code you can add a customised tab to Glimpse client.

Dedicated developers

In Glimpse you got 2 full time developers paid by a company (RedGate) to fully work on the product. It’s not common for someone to be able to work on their ‘Pet Project’ full time and get paid for it. The community should be grateful to RedGate.

Nick and Anthony provide quick and excellent support on various forums - Github, StackOverflow and Google groups. Their presence help filter and funnel the concerns (e.g from stackoverflow) to Github which is where the actual product gets improved.

Github & Low barrier for contribution

We already mentioned the fact that features such as open source, simple code & design encourages developers to take part. Glimpse is doing another simple yet effective activity where they label selected Github issues as ‘Jump In’. ‘Jump In’ tickets are chosen by experienced developers to invite newbies to the code base. This lowers the barrier a great deal for anyone who wants to contribute or at least get their hands dirty and learn in the process.

A use case

I have integrated Glimpse to an Enterprise Web Application and using it for both development and user support activities. The interesting use case is when Glimpse was found out to be useful in troubleshooting a nasty problem we have.

The user base for our enterprise web app is geographically distributed across different domains and networks. Once in awhile we get a user complain about the application being ‘slow’ and the server logs does not indicate anything out of the ordinary. Although we are convinced that the issue is either client (browser) related or most likely network related, it’s hard to prove it with solid evidence due to the lack of access/relationship we have with users and network operators.
Glimpse was used in this scenario as follows;
  • A glimpse policy was written to allow different levels of access to users on demand. Glimpse allows request data to be just captured without sending them back to the clients. We used it to capture end user data.
  • Send the Glimpse configuration url (glimpse.axd) to user and ask him to click on the 'Turn Glimpse On' button.
  • Developers were able to watch Glimpse traffic on their browser which included the traffic of the user that we are interested of.
  • When Glimpse broke down the response time between client-wire-server it was clear who the culprit was.

This provided our team with a chance to communicate to business with proper evidence regarding occasional performance issues caused by intermittent network/client problems.
Post a Comment