So you’ve decided that your new web application needs to record some page load time metrics so you can keep tabs on performance. Terrific! You set up a couple page load/complete functions to write to a logging table when a page request comes in, and then update the record when it finishes loading.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
INSERT INTO PageLogs (
RequestTime
,ResponseTime
,RemoteIP
,UserName
,PageId
,Parameters
,SessionId
)
VALUES (
GETDATE()
,NULL
,127.0.0.1
,'Dave'
,'Home'
,'Pd=2015Q2'
,'883666b1-99be-48c8-bf59-5a5739bc7d1d'
);
|
1
2
3
4
|
UPDATE PageLogs
SET ResponseTime = GETDATE()
WHERE
SessionId = '883666b1-99be-48c8-bf59-5a5739bc7d1d';
|
You set up an hourly job to delete any logs older than 2 weeks (just to prevent information overload) and you call it a day. Each morning, you run a report to look at the previous day’s performance, watch the trends over the past week or so, and you’re pretty happy with things. Pages are loading in a fraction of a second, according to the logs. People find the application useful, word spreads around the office, and adoption takes off. The project is a success!