-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathShowPageMedianLoadTimesForSite.sql
More file actions
28 lines (26 loc) Β· 1.25 KB
/
ShowPageMedianLoadTimesForSite.sql
File metadata and controls
28 lines (26 loc) Β· 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- =====================================================================================================
-- Author: Mike Peterson
-- Create Date: 9/29/2020
-- Description: Returns MedianPageLoadTimeDurationSeconds for Pages related to the specified @SiteId
--
-- Change History:
--
-- =====================================================================================================
DECLARE @SiteId INT = 8 -- The site we're interested in seeing median page load times for
DECLARE @IncludePagesWithoutMedianPageLoadTimes BIT = 0 -- set this to 1 to include pages that haven't had views or MedianPageLoadTimeDurationSeconds calculated
-- Print the Site Name to confirm that we're looking at the correct site
DECLARE @SiteName nvarchar(100) = (SELECT TOP 1 [Name] [Site.Name] FROM [Site] WHERE [Id] = @SiteId )
-- List Median Page Load Times (in seconds)
SELECT
@SiteName AS [SiteName]
, [p].[Id] AS [PageId]
, [p].[InternalName]
, [p].[PageTitle]
, [p].[MedianPageLoadTimeDurationSeconds]
FROM [Page] p
WHERE [p].[LayoutId] IN (
SELECT [Id]
FROM [Layout]
WHERE [SiteId] = @SiteId
) AND (@IncludePagesWithoutMedianPageLoadTimes = 1 OR [p].[MedianPageLoadTimeDurationSeconds] IS NOT NULL)
ORDER BY [p].[MedianPageLoadTimeDurationSeconds] DESC