MiniProfiler for profiling my ajax requests
How do I get a MiniProfiler to profile my ajax requests
For instance:
<div id="nav"> <ul> <li onclick="javascript:updateContent(1);">foo 1</li> <li onclick="javascript:updateContent(2);">foo 2</li> <li onclick="javascript:updateContent(3);">foo 3</li> </ul> </div> <div id="content"></div> <script type="text/javascript"> function updateContent(productId) { $.ajax({ url: '@Url.Action("GetProduct", "Product")', contentType: 'application/html; charset=utf-8', type: 'GET', dataType: 'html', traditional: true, data: { productId: productId } }) .success(function (result) { // Display the section contents. $('#content').html(result); }) .error(function (xhr, status) { alert(xhr.responseText); }); } </script> I would like to see the performance of each updateContent.
Any ideas?
I am using Asp.net MVC 3 and MiniProfiler 1.9 installed via NuGet
+4
1 answer
Already built-in, you do not need to do anything special.
Each time you execute an ajax request, a new time will be displayed.
You can see the demo at http://data.stackexchange.com .. write a request and run it, you will see that the time adds to the list.
+6