MiniProfiler个人资料我的Ajax请求我的、个人资料、MiniProfiler、Ajax

由网友(我有自己的专场)分享简介:我要如何MiniProfiler个人资料我的Ajax请求How do I get MiniProfiler to profile my ajax requests例如:foo 1我要如何MiniProfiler个人资料我的Ajax请求

How do I get MiniProfiler to profile my ajax requests

例如:

<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>

我希望看到每个updateContent的性能。

I would like to see the performance of each updateContent.

任何想法?

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

I am using Asp.net MVC 3 and MiniProfiler 1.9 installed via NuGet

推荐答案

已经内置,你不需要做什么特别的事情。

Already built in, you don't need to do anything special.

每次执行一个Ajax请求一个新的时间将显示出来。

Each time you execute an ajax request a new timing will show up.

您可以看到在 http://data.stackexchange.com ..演示编写查询和运行它,你会看到计时添加到列表中。

You can see a demo on http://data.stackexchange.com .. write a query and run it, you will see the timing add to the list.

阅读全文

相关推荐

最新文章