Is there another way to view the profiling results of MiniProfiler (I'm specifically interested in EF5 version)?
Every tutorial that I've seen uses MiniProfiler.RenderIncludes();
but since my MVC app mostly returns JSON, that is not an option for me.
Is there a way to write results to file or something like that?
You can read and write results to just about anywhere by changing the MiniProfiler.Settings.Storage
to a different IStorage
implementation from the default (which stores to http cache). If you wanted to, this could store to and read from a file pretty easily (you would have to write your own custom implementation for that).
The files served by RenderIncludes
are the html templates for displaying the results and the script to retrieve the results from the server and render them on the client (all found here). But you are by no means obliged to use this mechanism. If you want to write your own logic for retrieving and displaying results, you should base this off of the logic found in MiniProfilerHandler.GetSingleProfilerResult. This function roughly performs the following (putting in the siginificant steps for your purposes):
MiniProfiler.Settings.Storage.List()
)MiniProfiler.Settings.Storage.Load(id)
)MiniProfiler.Settings.Storage.SetViewed(user, id)
)ResultsJson
and returns itWith access to MiniProfiler.Settings.Storage
, you should be able to retrieve, serve and consume the profile results in any way that you want. And if you are interested in using the RenderIncludes
engine but want to mess around with the html/js being served, you can provide your own custom ui templates that will replace the default behavior.