哪些实用程序可以提供每页的数据库点击次数/持续时间?
SQL Server 探查器非常适合分析 Web 应用程序的 SQL Server 性能。 但是,当我测试我的网络应用程序时,我想要每页数据库点击/持续时间的摘要。
有人知道有什么实用程序可以为您提供此类信息吗?
SQL Server profiler is great for profiling SQL Server performance for web apps. However, when I'm testing my webapp I'd like a summary of database hits/duration per page.
Does anybody know of any utilities for giving you this kind of information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你想要每页的持续时间,我推荐谷歌分析。
如果您想要数据库点击的摘要(即,您在一页加载期间运行三个过程,因此您想要显示三的计数),那么我建议将审核代码添加到您的存储过程中。
或者(尽管在处理方面成本更高),您可以打开 SQL Profiler 或 SQL Trace,然后以这种方式跟踪数据库命中以对它们执行统计分析。
If you want duration per page, I'd recommand Google Analytics.
If you want a summary of database hits (ie, you run three procedures during one page load so you want to show a count of three) then I would recommend adding auditing code to your sprocs.
Alternately (though more expensively in terms of processing) you could turn on either SQL Profiler or SQL Trace and then track the database hits that way to perform statistical analysis on them.
我建议设置一个将用于所有站点的数据访问例程。
这个例程/类/或任何您喜欢的内容都可以登录数据库或记录所有“点击”、它们的持续时间、错误(是否有)、超时等。
如果您正确编程,您将能够知道如何许多数据库点击/页面加载,平均(DBHit)+您将获得免费奖励“最长的SProc,最短的,更常被调用”。
这样做的积极的一面是,您不需要修改任何存储过程,并且可以在对数据库的访问周围有一个漂亮的小“包装器”。
对于“每页持续时间”,如果您使用谷歌分析,您将无法将信息与您在数据库服务器上获得的信息合并回来。 因此,我建议记录对数据库中页面的每次访问。
然后您可以推断出 Page1.StartTime = getdate()、Page1.EndTime = (page2.Starttime-1 或 session.log_off_time) 例如。 [这个有点基础,但是根据你的环境你可以改进它]。
I would recommend setting a data access routine that will be used for all the site.
This routine/class/or whatever you like could log in the database or in a log all the "hits", their duration, error (is any), timeout, etc.
If you program it properly, you will be able to know how many DB hit / page load, avg(DBHit) + you will get as a free bonus the "longest SProc, shortest, more often called".
The positive side of this is that you don't need to modify any stored proc and you can have a nice little "wrapper" around your access to the DB.
For the "Duration per page", if you go with google analysis you will not be able to merge the information back with what you got on the database server. So I would recommend logging each access to a page in the DB.
Then you can infer that Page1.StartTime = getdate(), Page1.EndTime = (page2.Starttime-1 or session.log_off_time) for example. [This is a little basic but according to your environment you can improve it].