MiniProfiler个人资料我的Ajax请求 [英] MiniProfiler to profile my ajax requests
本文介绍了MiniProfiler个人资料我的Ajax请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要如何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.
这篇关于MiniProfiler个人资料我的Ajax请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文