Average executing time for ASP.NET pages

Courtesy of “A Developer Strayings” blog:

logparser “SELECT AVG(time-taken) As AverageTimeTaken, MAX(time-taken) As MaxTimeTaken, COUNT(*) As Hits, TO_LOWERCASE(cs-uri-stem) INTO %1 FROM *.log WHERE EXTRACT_EXTENSION(TO_LOWERCASE(cs-uri-stem)) = ‘%2’ GROUP BY cs-uri-stem ORDER BY AverageTimeTaken DESC” -i:IISW3C -RTP:-1

The output will look like this:

Elements processed: 309751
Elements output: 0
Execution time: 1.45 seconds

LogParser syntax to see long-running pages

After enabling the time-taken logfile attribute, you can view the longest-running pages (in milliseconds) by using a SQL query and LogParser:

logparser -o:DATAGRID “select cs-uri-stem,time-taken,cs-username fro
m ex080214.log where time-taken > 10000 order by time-taken”

This will return a datagrid where you can review the pages that took the longest, and troubleshoot them.