IIS 日志解析器 - 需要查询来查找“总请求数>” x秒” /“总请求数”按 URL 分组
我正在支持一个偶尔出现性能问题的应用程序。客户想知道页面缓慢的频率。
即页面花费超过 x 秒的总时间/页面的请求总数
我想编写一个查询来获取所需的数据。
像这样的东西在 SQL 中可能会起作用,但在 IIS 日志解析器中不起作用。
select URL, count(case when time > 100 then 1 else null end), count(*)
from table1
group by URL
I am supporting an application that is having occasional performance issues. The client wants to know how often a page is slow.
i.e. Total times a page took greater than x secs / Total number of requests for the page
I would like to write a single query to fetch the desired data.
Something like this in SQL would probably work but isn't working in IIS Log parser.
select URL, count(case when time > 100 then 1 else null end), count(*)
from table1
group by URL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里的问题是您需要两个查询。
无论花费多少时间,都可以计算每页的请求总数
用于计算花费时间 > 的页面数。 X秒
您所追求的结果需要 JOIN:
不幸的是 LogParser 中不支持 JOIN。
您可以做的是将两个查询的结果导入 SQL 数据库并在那里运行查询:
The problem here is that you need two queries.
One to count the total number of requests per page regardless of time taken
One to count the number of pages where time-taken > X seconds
The result you're after would require a JOIN:
Unfortunately there is no support for JOIN's in LogParser.
What you could do is import the results of both queries into a SQL Database and run the query there: