-1

I have recently built my own plugin for Glimpse to see all my Couchbase traffic, and would love to see statistics on what is going on in Autofac. Is there any work being done on an Autofac plugin for Glimpse? All I can find is the one from three years ago, but I don't think it shows a whole lot of detail.

Ideally what I would be looking for would be a full plugin that can do timings also, to measure the performance of Autofac using Glimpse and work out how much time is taken to resolve instances to isolate potential performance bottlenecks.

Has anyone done something like this? If not, does Autofac have hooks we could hook into to capture that stuff and log it?

Kendall Bennett
  • 2,353
  • 1
  • 17
  • 18

1 Answers1

1

I'm not aware of anyone who is currently creating a Glimpse extension for Autofac.

As you mentioned, there is an extension out there now, but it might not be as detailed as you'd like.

All that said, it seems like Autofac's Activation Events would make it pretty simple to create a new Glimpse extension to expose some of the data that you're after.

For timings, if you are using an IServiceLocator in MVC, you could also create a GlimpseServiceLocator which uses a Stopwatch to get timing information.

nikmd23
  • 9,095
  • 4
  • 42
  • 57
  • Yeah I was looking at the activation events. So it would seem that hooking OnActivating to start the timer and then OnActivated to stop it should catch the activation events and the time involved in resolving objects? I am using the service locator for MVC, but can you shed more light on how to use that to capture activation timings? – Kendall Bennett Mar 08 '16 at 07:17
  • Basically you could add the Stopwatch calls to your implementation of the service worker. It would solve your immediate need, but is a solution specific to your current application. Using the events from AutoFac is a more generic and reusable way to solve the problem if that's the goal. – nikmd23 Mar 09 '16 at 14:14