mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Allow Step to be used in a non-IDisposable pattern. #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please provide the option for a non-IDisposable version of Step.

This could use a Dictionary<T> internally, or whatever.

Original issue reported on code.google.com by Spoonful...@gmail.com on 9 Jun 2011 at 5:52

GoogleCodeExporter commented 8 years ago
That is, a Dictionary<string, Queue<IDisposable>>

Original comment by Spoonful...@gmail.com on 9 Jun 2011 at 7:18

GoogleCodeExporter commented 8 years ago
I am envisioning something like:

    myProfiler.StepIn("Do a thing.");
    ...
    myProfiler.StepOut("Do a thing.");

Original comment by Spoonful...@gmail.com on 13 Jun 2011 at 7:35

GoogleCodeExporter commented 8 years ago
Sorry, I meant `Dictionary<string, Stack<IDisposable>>`

Original comment by Spoonful...@gmail.com on 15 Jun 2011 at 12:47

GoogleCodeExporter commented 8 years ago

Original comment by nrcraver on 20 Jun 2011 at 12:03

GoogleCodeExporter commented 8 years ago
An additional benefit of this is that doing this allows one to write an Action 
Filter attribute and use that to decorate your controller actions.

Original comment by codedemonuk on 29 Jun 2011 at 3:09

GoogleCodeExporter commented 8 years ago
I am no following how this differs from ... 

var prof = prof.Step("my step"); 
prof.Dispose(); 

or 

StepIn and StepOut can be trivially implemented using our current constructs. I 
don't want people to need to pick an API it will only cause confusion. Instead 
if you feel strongly about this, just implement wrappers.

Original comment by sam.saff...@gmail.com on 13 Jul 2011 at 4:50

GoogleCodeExporter commented 8 years ago
The difference being that he profile need to keep a state of what steps are 
currently executing. Today if using the profiler when implementing it in a Asp 
.Net MVC Filter I as a user of the profiler need to keep this state...

Original comment by polyz...@gmail.com on 13 Jul 2011 at 11:10

GoogleCodeExporter commented 8 years ago
If the `Step` and `Dispose` calls are in different parts of the application, I 
have to put the `IDisposable` in global state.

Original comment by Spoonful...@gmail.com on 13 Jul 2011 at 2:12

GoogleCodeExporter commented 8 years ago
That being said, without a place to put that state, it is IMPOSSIBLE to 
implement those ourselves.

Original comment by Spoonful...@gmail.com on 13 Jul 2011 at 2:13