• All geek questions in one place

    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
    javascript ajax mvc-mini-profiler
    Terenced Dec 21 '11 at 19:41
    source share
    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
    Sam saffron Dec 23 '11 at 6:30
    source share

    Source: https://habr.com/ru/post/1387452/

    More articles:

    • What does this [Serializable] attribute that ISERializable does not support? - c #
    • The exact way to measure overhead in kernel space - performance
    • Template class specialization for several types satisfying the condition - c ++
    • the most common configuration flags for installing R from a source on 64-bit Ubuntu - r
    • Script package prefix for file names - file-io
    • What objects are terminated in Go by default and what are some of these errors? - garbage-collection
    • Why does DateTimeConverter.ConvertFrom work with empty strings? - c #
    • iOS - how to compare twice? - ios
    • Can a custom editorTemplate call EditorTemplate by default for the same model inside it - asp.net-mvc
    • Persistent local domain socket in php - javascript

    All Articles

    Geek Questions | 2019