home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
moodle.waes.ac.uk
/
moodle.waes.ac.uk.zip
/
moodle.waes.ac.uk
/
TMG
/
SP1-TMG-KB981324-AMD64-ENU.msp
/
PCW_CAB_SHFx2
/
F2143_msfpcui.dll
/
BINARY
/
25446
< prev
next >
Wrap
Text File
|
2010-06-15
|
3KB
|
76 lines
CREATE PROCEDURE [dbo].[ISA_spDailyTrafficSummaryRDL]
@ReportType varchar(10),
@FromDate datetime,
@ToDate datetime
AS
BEGIN
DECLARE @SummTableName varchar(100)
SET @SummTableName = dbo.fnGetSummaryTableName('tblTrafficSummary', @FromDate, @ToDate, @ReportType)
CREATE TABLE #Table1
(
Interval int,
RequestsPerSecond float,
TotalBytesPerSecond bigint,
TotalCachedProcessingTime bigint,
TotalCachedRequests bigint,
TotalNonCachedProcessingTime bigint,
TotalNonCachedRequests bigint,
MaxConcurrentConnectionsPerMinute bigint,
TotalCacheHits bigint,
TotalWebRequests bigint,
TotalBytes bigint
)
IF OBJECT_ID (@SummTableName, 'u') IS NOT NULL
BEGIN
DECLARE @strQuery varchar(8000)
SET @strQuery =
'SELECT
[Interval] AS Interval,
CAST (SUM([Requests]) As Decimal)/(15*60) As RequestsPerSecond,
SUM([TotalBytes])/(15*60) AS TotalBytesPerSecond,
SUM([CachedProcessingTime]) AS TotalCachedProcessingTime,
SUM([CachedRequests]) AS TotalCachedRequests,
SUM([NonCachedProcessingTime]) AS TotalNonCachedProcessingTime,
SUM([NonCachedRequests]) AS TotalNonCachedRequests,
MAX([MaxConcurrentConnectionsPerMinute]) AS MaxConcurrentConnectionsPerMinute,
SUM([CacheHits]) AS TotalCacheHits,
SUM([WebRequests]) AS TotalWebRequests,
SUM([TotalBytes]) AS TotalBytes
FROM ' + @SummTableName + '
WHERE ([date] >= ' + QUOTENAME(CONVERT(varchar, @FromDate, 126),CHAR(39)) + ' AND [date] <= ' + QUOTENAME(CONVERT(varchar, @ToDate, 126),CHAR(39)) + ')
GROUP BY
[Interval]
'
INSERT #Table1
EXEC(@strQuery)
END
DECLARE @ZeroTime smalldatetime = '1999-1-1'
SELECT
DATEADD(minute, [Interval] , @ZeroTime) AS Interval,
[RequestsPerSecond],
[TotalBytesPerSecond],
CASE
WHEN [TotalCachedRequests] = 0 THEN 0
ELSE [TotalCachedProcessingTime]/[TotalCachedRequests]/1000
END AS CachedProcessingTime,
CASE
WHEN [TotalNonCachedRequests] = 0 THEN 0
ELSE [TotalNonCachedProcessingTime]/[TotalNonCachedRequests]/1000
END AS NonCachedProcessingTime,
[MaxConcurrentConnectionsPerMinute],
CASE
WHEN [TotalWebRequests] = 0 THEN 0
ELSE CAST([TotalCacheHits] AS decimal)/[TotalWebRequests]
END AS CacheHitRatio,
[TotalBytes]
FROM #Table1
ORDER BY [Interval] ASC
END