MiniProfiler用于分析我的ajax请求

Ter*_*ced 4 javascript ajax mvc-mini-profiler

如何让MiniProfiler分析我的ajax请求

例如:

<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>
Run Code Online (Sandbox Code Playgroud)

我想看看每个updateContent的性能.

有任何想法吗?

我正在使用通过NuGet安装的Asp.net MVC 3和MiniProfiler 1.9

Sam*_*ron 6

已经内置,你不需要做任何特别的事情.

每次执行ajax请求时,都会显示新的时间.

你可以在http://data.stackexchange.com上看到一个演示..编写一个查询并运行它,你会看到时间添加到列表中.