IIS 日志中的 95% 平均百分比

发布于 2024-12-14 07:53:51 字数 805 浏览 0 评论 0原文

我正在准备进行生产推送,不幸的是以前的系统没有记录性能统计数据。

我有 IIS 日志,并且能够计算吞吐量和平均/最大要求。

有没有办法计算 95% 时间平均值和最大要求,以便数字不包括最大值?我对频谱的整个范围不感兴趣,我只想删除一些最大超时,以更好地近似当前系统的吞吐量。

我当前的查询是

SELECT
    DatePart(Year,date_time),
    DatePart(Month,date_time),
    DatePart(Day,date_time),
    DatePart(hh,date_time),
    count(*) as [Req/h],
    COUNT(*)/3600 as [Req/s],
    COUNT(*)/60 as [Req/m],
    sum([time-taken]) / count(*) as AverageServerTime,
    Max([time-taken]) as MaxServerTime
  FROM [iis_logs].[dbo].[events]
  where 
  uri_stem like 'stemprefix/%' and 
  host ='www.domain.com'
   and date_time > '11/8/2011'
   and date_time < '11/9/2011'
  group by  
    DatePart(Year,date_time),
    DatePart(Month,date_time),
    DatePart(Day,date_time),
    DatePart(hh,date_time)

I'm getting ready for a production push and unfortuanally the previous system does not document performance stats.

I have the IIS logs and have been able to calculate Throughput and average/max requirements.

Is there a way to calculate the 95% time average and max requirements so that the figures don't include the max values? I'm not interested in the full rang of the spectrum, I just want to drop a few of the max times out to see a beter approximation of what the throughput of the current system is.

My Current Query is

SELECT
    DatePart(Year,date_time),
    DatePart(Month,date_time),
    DatePart(Day,date_time),
    DatePart(hh,date_time),
    count(*) as [Req/h],
    COUNT(*)/3600 as [Req/s],
    COUNT(*)/60 as [Req/m],
    sum([time-taken]) / count(*) as AverageServerTime,
    Max([time-taken]) as MaxServerTime
  FROM [iis_logs].[dbo].[events]
  where 
  uri_stem like 'stemprefix/%' and 
  host ='www.domain.com'
   and date_time > '11/8/2011'
   and date_time < '11/9/2011'
  group by  
    DatePart(Year,date_time),
    DatePart(Month,date_time),
    DatePart(Day,date_time),
    DatePart(hh,date_time)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软甜啾 2024-12-21 07:53:51

这似乎符合我的要求(它不按小时报告,但对于我的目的来说已经足够好了)。

Select 
    sum(t.time) / count(*) as AverageServerTime,
    Max(t.time) as MaxServerTime
    From
    (
SELECT Top 95 percent
    [time-taken] as time
  FROM [iis_logs].[dbo].[events]
  where 
  uri_stem like 'prefix%' and 
  host ='www.domain.com'
   and date_time > '11/8/2011'
   and date_time < '11/9/2011'
  order by [time-taken]
) t

This seems to do what I'm looking for (it doesn't report based on hour, but that good enough for my purposes).

Select 
    sum(t.time) / count(*) as AverageServerTime,
    Max(t.time) as MaxServerTime
    From
    (
SELECT Top 95 percent
    [time-taken] as time
  FROM [iis_logs].[dbo].[events]
  where 
  uri_stem like 'prefix%' and 
  host ='www.domain.com'
   and date_time > '11/8/2011'
   and date_time < '11/9/2011'
  order by [time-taken]
) t
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文