Skip to content

Commit 69f4485

Browse files
authored
Merge pull request #59 from Jorriss/master
Truing up dev with master
2 parents 0d565d3 + a21dfeb commit 69f4485

File tree

5 files changed

+162
-6
lines changed

5 files changed

+162
-6
lines changed

Example.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Example Statistics IO Output
2+
3+
## Input statement
4+
5+
SQL Server parse and compile time:<br />
6+
CPU time = 108 ms, elapsed time = 108 ms.
7+
8+
(13431682 row(s) affected)<br />
9+
Table 'PostTypes'. Scan count 1, logical reads 2, physical reads 1, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
10+
Table 'Users'. Scan count 5, logical reads 42015, physical reads 1, read-ahead reads 41306, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
11+
Table 'Comments'. Scan count 5, logical reads 1089402, physical reads 248, read-ahead reads 1108174, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
12+
Table 'PostTags'. Scan count 5, logical reads 77500, physical reads 348, read-ahead reads 82219, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
13+
Table 'Posts'. Scan count 5, logical reads 397944, physical reads 9338, read-ahead reads 402977, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
14+
Table 'Worktable'. Scan count 999172, logical reads 16247024, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
15+
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
16+
17+
SQL Server Execution Times:<br />
18+
CPU time = 156527 ms, elapsed time = 284906 ms.<br />
19+
SQL Server parse and compile time:<br />
20+
CPU time = 16 ms, elapsed time = 19 ms.<br />
21+
22+
(233033 row(s) affected)<br />
23+
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
24+
Table 'Votes'. Scan count 1, logical reads 250128, physical reads 10, read-ahead reads 250104, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
25+
Table 'Posts'. Scan count 1, logical reads 165586, physical reads 18, read-ahead reads 49191, lob logical reads 823463, lob physical reads 42854, lob read-ahead reads 3272.<br />
26+
Table 'Users'. Scan count 1, logical reads 41405, physical reads 3, read-ahead reads 41401, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
27+
28+
SQL Server Execution Times:<br />
29+
CPU time = 17207 ms, elapsed time = 38163 ms.<br />
30+
Msg 207, Level 16, State 1, Line 1<br />
31+
Invalid column name 'scores'.<br />
32+
SQL Server parse and compile time:<br />
33+
CPU time = 0 ms, elapsed time = 0 ms.
34+
35+
SQL Server Execution Times:<br />
36+
CPU time = 0 ms, elapsed time = 0 ms.
37+
38+
## Output Statement
39+
40+
|| CPU | Elapsed |
41+
|------------------------------------|--------------|--------------|
42+
| SQL Server parse and compile time: | 00:00:00.108 | 00:00:00.108 |
43+
44+
**13,431,682 rows affected**
45+
46+
| Row Num | Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
47+
|---------|-----------|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|----------------------|-------------------------------:|
48+
| | Total | 999,193 | 17,853,887 | 9,936 | 1,634,676 | 0 | 0 | 0 | |
49+
| | PostTypes | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 0.000 |
50+
| | Users | 5 | 42,015 | 1 | 41,306 | 0 | 0 | 0 | 0.235 |
51+
| | Comments | 5 | 1,089,402 | 248 | 1,108,174 | 0 | 0 | 0 | 6.102 |
52+
| | PostTags | 5 | 77,500 | 348 | 82,219 | 0 | 0 | 0 | 0.434 |
53+
| | Posts | 5 | 397,944 | 9,338 | 402,977 | 0 | 0 | 0 | 2.229 |
54+
| | Worktable | 999,172 | 16,247,024 | 0 | 0 | 0 | 0 | 0 | 91.000 |
55+
| | Worktable | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
56+
57+
|| CPU | Elapsed |
58+
|-----------------------------|--------------|--------------|
59+
| SQL Server Execution Times: | 00:02:36.527 | 00:04:44.906 |
60+
61+
|| CPU | Elapsed |
62+
|------------------------------------|--------------|--------------|
63+
| SQL Server parse and compile time: | 00:00:00.016 | 00:00:00.019 |
64+
65+
**233,033 rows affected**
66+
67+
| Row Num | Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
68+
|---------|----------:|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|---------------------:|-------------------------------:|
69+
| | Total | 3 | 457,119 | 31 | 340,696 | 823,463 | 42,854 | 3,272 | |
70+
| | Worktable | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
71+
| | Votes | 1 | 250,128 | 10 | 250,104 | 0 | 0 | 0 | 54.718 |
72+
| | Posts | 1 | 165,586 | 18 | 49,191 | 823,463 | 42,854 | 3,272 | 36.224 |
73+
| | Users | 1 | 41,405 | 3 | 41,401 | 0 | 0 | 0 | 9.058 |
74+
75+
|| CPU | Elapsed |
76+
|-----------------------------|--------------|--------------|
77+
| SQL Server Execution Times: | 00:00:17.207 | 00:00:38.163 |
78+
79+
**Msg 207, Level 16, State 1, Line 1<br />
80+
Invalid column name 'scores'.**
81+
82+
|| CPU | Elapsed |
83+
|------------------------------------|--------------|--------------|
84+
| SQL Server parse and compile time: | 00:00:00.000 | 00:00:00.000 |
85+
86+
|| CPU | Elapsed |
87+
|-----------------------------|--------------|--------------|
88+
| SQL Server Execution Times: | 00:00:00.000 | 00:00:00.000 |
89+
90+
#### Totals:
91+
92+
| Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
93+
|-----------|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|---------------------:|-------------------------------:|
94+
| Total | 999,196 | 18,311,006 | 9,967 | 1,975,372 | 823,463 | 42,854 | 3,272 | |
95+
| Comments | 5 | 1,089,402 | 248 | 1,108,174 | 0 | 0 | 0 | 5.949 |
96+
| Posts | 6 | 563,530 | 9,356 | 452,168 | 823,463 | 42,854 | 3,272 | 3.078 |
97+
| PostTags | 5 | 77,500 | 348 | 82,219 | 0 | 0 | 0 | 0.423 |
98+
| PostTypes | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 0.000 |
99+
| Users | 6 | 83,420 | 4 | 82,707 | 0 | 0 | 0 | 0.456 |
100+
| Votes | 1 | 250,128 | 10 | 250,104 | 0 | 0 | 0 | 1.366 |
101+
| Worktable | 999,172 | 16,247,024 | 0 | 0 | 0 | 0 | 0 | 88.728 |
102+
103+
|| CPU | Elapsed |
104+
|------------------------------------|--------------|--------------|
105+
| SQL Server parse and compile time: | 00:00:00.124 | 00:00:00.127 |
106+
| SQL Server Execution Times: | 00:02:53.734 | 00:05:23.069 |
107+
| Total | 00:02:53.858 | 00:05:23.196 |

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
Statistics-IO-Parser
2-
====================
1+
# Microsoft SQL Server Statistics IO and Time Parser
2+
Sometimes reading SQL Server output from Statistics IO and Statistics Time can be a total drag. This page will help with that. Just paste in the output of Statistics IO and/or Statistics Time and press Parse. Your output will be formatted and totaled. Enjoy.
3+
4+
Useful links:
5+
- [SET STATISTICS IO (Transact-SQL)](https://msdn.microsoft.com/en-us/library/ms184361.aspx)
6+
- [SET STATISTICS TIME (Transact-SQL)](https://msdn.microsoft.com/en-us/library/ms190287.aspx)
7+
8+
## [Example](/Example.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"langvalue" : "it",
3+
"langname" : "Italian" ,
4+
"table" : "Tabella",
5+
"scan" : "Conteggio analisi ",
6+
"logical" : "letture logiche ",
7+
"physical" : "letture fisiche ",
8+
"readahead" : "letture read-ahead ",
9+
"loblogical" : "letture logiche LOB ",
10+
"lobphysical" : "letture fisiche LOB ",
11+
"lobreadahead" : "letture LOB read-ahead ",
12+
"headerrownum" : "Riga",
13+
"headertable" : "Tabella",
14+
"headerscan" : "Conteggio analisi",
15+
"headerlogical" : "Letture logiche",
16+
"headerphysical" : "Letture fisiche",
17+
"headerreadahead" : "Letture read-ahead",
18+
"headerloblogical" : "Letture logiche LOB",
19+
"headerlobphysical" : "Letture fisiche LOB",
20+
"headerlobreadahead" : "Letture LOB read-ahead",
21+
"headerperlogicalread" : "% Letture logiche sul totale",
22+
"executiontime" : "Tempo di esecuzione SQL Server:",
23+
"compiletime" : "Tempo di analisi e compilazione SQL Server:",
24+
"cputime" : "tempo di CPU = ",
25+
"elapsedtime" : "tempo trascorso = ",
26+
"elapsedlabel" : "Tempo trascorso",
27+
"cpulabel" : "CPU",
28+
"milliseconds" : "ms",
29+
"rowsaffected" : "righe interessate" ,
30+
"headerrowsaffected" : " righe interessate",
31+
"headerrowaffected" : " riga interessata",
32+
"errormsg" : "Mes",
33+
"sampleoutput" : "Tempo di analisi e compilazione SQL Server: \r\n tempo di CPU = 0 ms, tempo trascorso = 0 ms.\r\n\r\n(25499 righe interessate)\r\nTabella \u0027Workfile\u0027. Conteggio analisi 0, letture logiche 0, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027Worktable\u0027. Conteggio analisi 0, letture logiche 0, letture fisiche 0, letture server di pagine 0, letture read-ahead 856, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027FATRIG\u0027. Conteggio analisi 1, letture logiche 13563, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027FATTES\u0027. Conteggio analisi 1, letture logiche 3748, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027COMRIG\u0027. Conteggio analisi 1, letture logiche 170, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CONTI\u0027. Conteggio analisi 1, letture logiche 224, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027TIPIDOC\u0027. Conteggio analisi 2, letture logiche 8, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahea LOB server di pagine 0.\r\nTabella \u0027COMTES\u0027. Conteggio analisi 1, letture logiche 1702, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CLIENTI\u0027. Conteggio analisi 2, letture logiche 20, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027PERSONE\u0027. Conteggio analisi 4, letture logiche 794, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027ANAPAG\u0027. Conteggio analisi 1, letture logiche 5, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027NAZIONI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027AGENTI\u0027. Conteggio analisi 2, letture logiche 4, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027LOTSER\u0027. Conteggio analisi 1, letture logiche 18, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027ARTICO\u0027. Conteggio analisi 1, letture logiche 370, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CLASSI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CATOMO\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027GRUPPI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027LINEEP\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027MARCHE\u0027. Conteggio analisi 1, letture logiche 4, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\n\r\nTempo di esecuzione SQL Server: \r\n tempo di CPU = 657 ms, tempo trascorso = 944 ms.\r\n\r\nMessaggio 207, livello 16, stato 1, riga 1\r\nIl nome di colonna \u0027test\u0027 non è valido.\r\n"
34+
}
35+
36+

src/assets/js/statsioparser.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ function determineLang(strRow){
7979

8080
if (strRow.substring(0,7) === 'Table \'') { lang = 1; } // English
8181
else if (strRow.substring(0, 7) === 'Tabla \'') { lang = 2; } // Spanish
82+
else if (strRow.substring(0, 7) === 'Tabella \'') { lang = 3; } // Italian
8283
else if ($.trim(strRow.substring(0, 6)) === 'Tiempo') { lang = 2; } // Spanish
84+
else if ($.trim(strRow.substring(0, 6)) === 'Tempo') { lang = 3; } // Italian
8385
else if ($.trim(strRow.substring(0, 7)) === 'Tiempos') { lang = 2; } // Spanish
86+
else if ($.trim(strRow.substring(0, 7)) === 'Tempo') { lang = 3; } // Italian
8487

8588
return lang;
8689
}
@@ -94,6 +97,9 @@ function determineLangFilename (langType) {
9497
case 'es': // Spanish
9598
filename = 'assets/data/languagetext-es.json'
9699
break;
100+
case 'it': // Italian
101+
filename = 'assets/data/languagetext-it.json'
102+
break;
97103
default :
98104
filename = 'assets/data/languagetext-en.json'
99105
break;
@@ -353,7 +359,7 @@ function outputTimeTable(timeValues, langTitle, langDuration, elapsedLabel, cpuL
353359
//result += '<td class="td-column-right">' + numeral(timeValues.elapsed).format('0,0') + '</td>';
354360
result += '<td class="td-column-right">' + formatms(timeValues.cpu) + '</td>';
355361
result += '<td class="td-column-right">' + formatms(timeValues.elapsed) + '</td>';
356-
result += '</tr></tbody></table><div>';
362+
result += '</tr></tbody></table></div>';
357363

358364
return result;
359365
}
@@ -390,7 +396,7 @@ function outputTimeTableTotals(executionValues, compileValues, langCompileTitle,
390396
//result += '<td class="td-total td-column-right">' + numeral(elapsedTotal).format('0,0') + '</td>';
391397
result += '<td class="td-total td-column-right">' + formatms(cpuTotal) + '</td>';
392398
result += '<td class="td-total td-column-right">' + formatms(elapsedTotal) + '</td>';
393-
result += '</tr></tfoot></table><div>';
399+
result += '</tr></tfoot></table></div>';
394400

395401
return result;
396402
}

0 commit comments

Comments
 (0)