Created
September 3, 2018 04:10
-
-
Save smaglio81/3a862a4d8b69db8b60a2d2c3e8037c4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create procedure usp_Regenerate_ProxySiteRequestStats | |
as | |
truncate table dbo.ProxySiteRequestStats; | |
insert into dbo.ProxySiteRequestStats | |
select sitename | |
,avg(RequestCounts) [avg] | |
,stdev(RequestCounts) [stdev] | |
,ceiling(avg(RequestCounts) + (2 * stdev(RequestCounts))) [95th] | |
,min(RequestCounts) [min] | |
,max(RequestCounts) [max] | |
from dbo.ProxySiteRequestCounts | |
group by sitename | |
go | |
exec usp_Regenerate_ProxySiteRequestStats; | |
select * | |
from dbo.ProxySiteRequestStats | |
/* | |
USE [IisLogs] | |
GO | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[ProxySiteRequestStats]( | |
[SiteName] [varchar](255) NOT NULL, | |
[Avg] [decimal](18, 0) NULL, | |
[Stdev] [decimal](18, 0) NULL, | |
[95th] [decimal](18, 0) NULL, | |
[min] [bigint] NULL, | |
[max] [bigint] NULL, | |
CONSTRAINT [PK_ProxySiteRequestStats] PRIMARY KEY CLUSTERED | |
( | |
[SiteName] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment