@@ -151,30 +151,31 @@ public String getHTMLStats() {
151151
152152 StringBuilder str = new StringBuilder ();
153153
154- str .append ("<table border=\" 0\" cellspacing=\" 5\" >" );
155-
154+ str .append ("<table border=\" 0\" cellspacing=\" 5\" class=\" stats\" >" );
156155
157156 synchronized (bytes ) {
158157 // Starting time
159- str .append ("<tr><td colspan=\" 2\" >Started:</td><td colspan=\" 3\" >" );
158+ str .append ("<tbody>" );
159+ str .append ("<tr><th colspan=\" 2\" scope=\" row\" >Started:</th><td colspan=\" 3\" >" );
160160 str .append (ServletUtils .formatTimestamp (this .startTime )+ " (" + formatTimeDiff (runningTime ) + ") " );
161161 str .append ("</td></tr>\n " );
162162
163- str .append ("<tr><td colspan=\" 2\" >Total number of requests:</td ><td colspan=\" 3\" >" +totalRequests );
163+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Total number of requests:</th ><td colspan=\" 3\" >" +totalRequests );
164164 str .append (" (" + totalRequests / (runningTime ) +"/s ) " );
165165 str .append ("</td></tr>\n " );
166166
167- str .append ("<tr><td colspan=\" 2\" >Total number of untiled WMS requests:</td ><td colspan=\" 3\" >" +totalWMS );
167+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Total number of untiled WMS requests:</th ><td colspan=\" 3\" >" +totalWMS );
168168 str .append (" (" + totalWMS / (runningTime ) +"/s ) " );
169169 str .append ("</td></tr>\n " );
170170
171- str .append ("<tr><td colspan=\" 2\" >Total number of bytes:</td ><td colspan=\" 3\" >" +totalBytes );
171+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Total number of bytes:</th ><td colspan=\" 3\" >" +totalBytes );
172172 str .append (" (" +formatBits ((totalBytes *8.0 )/(runningTime ))+") " );
173173 str .append ("</td></tr>\n " );
174174
175- str .append ("<tr><td colspan=\" 5\" > </td></tr>" );
175+ str .append ("</tbody>" );
176+ str .append ("<tbody>" );
176177
177- str .append ("<tr><td colspan=\" 2\" >Cache hit ratio:</td ><td colspan=\" 3\" >" );
178+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Cache hit ratio:</th ><td colspan=\" 3\" >" );
178179 if (totalHits + totalMisses > 0 ) {
179180 double hitPercentage = (totalHits * 100.0 ) / (totalHits + totalMisses );
180181 int rounded = (int ) Math .round (hitPercentage * 100.0 );
@@ -187,7 +188,7 @@ public String getHTMLStats() {
187188
188189 str .append ("</td></tr>\n " );
189190
190- str .append ("<tr><td colspan=\" 2\" >Blank/KML/HTML:</td ><td colspan=\" 3\" >" );
191+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Blank/KML/HTML:</th ><td colspan=\" 3\" >" );
191192 if (totalRequests > 0 ) {
192193 if (totalHits + totalMisses == 0 ) {
193194 str .append ("100.0% of requests" );
@@ -202,9 +203,10 @@ public String getHTMLStats() {
202203 }
203204 str .append ("</td></tr>\n " );
204205
205- str .append ("<tr><td colspan=\" 5\" > </td></tr>" );
206+ str .append ("</tbody>" );
207+ str .append ("<tbody>" );
206208
207- str .append ("<tr><td colspan=\" 2\" >Peak request rate:</td ><td colspan=\" 3\" >" );
209+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Peak request rate:</th ><td colspan=\" 3\" >" );
208210 if (totalRequests > 0 ) {
209211 str .append (formatRequests ( (peakRequests * 1.0 ) / pollInterval ));
210212 str .append (" (" +ServletUtils .formatTimestamp (peakRequestsTime )+") " );
@@ -213,7 +215,7 @@ public String getHTMLStats() {
213215 }
214216 str .append ("</td></tr>\n " );
215217
216- str .append ("<tr><td colspan=\" 2\" >Peak bandwidth:</td ><td colspan=\" 3\" >" );
218+ str .append ("<tr><th colspan=\" 2\" scope= \" row \" >Peak bandwidth:</th ><td colspan=\" 3\" >" );
217219 if (totalRequests > 0 ) {
218220 str .append (formatBits ((peakBytes * 8.0 ) / pollInterval ));
219221 str .append (" (" +ServletUtils .formatTimestamp (peakRequestsTime )+") " );
@@ -222,9 +224,10 @@ public String getHTMLStats() {
222224 }
223225 str .append ("</td></tr>\n " );
224226
225- str .append ("<tr><td colspan=\" 5\" > </td></tr>" );
227+ str .append ("</tbody>" );
228+ str .append ("<tbody>" );
226229
227- str .append ("<tr><td >Interval</td><td >Requests</td><td >Rate</td><td >Bytes</td><td >Bandwidth</td ></tr>\n " );
230+ str .append ("<tr><th scope= \" col \" >Interval</th><th scope= \" col \" >Requests</th><th scope= \" col \" >Rate</th><th scope= \" col \" >Bytes</th><th scope= \" col \" >Bandwidth</th ></tr>\n " );
228231
229232 for (int i =0 ; i <intervals .length ; i ++) {
230233 if (runningTime < intervals [i ]) {
@@ -244,13 +247,17 @@ public String getHTMLStats() {
244247 +"</tr>\n " );
245248 }
246249
247- str .append ("<tr><td colspan=\" 5\" > </td></tr>" );
250+ str .append ("</tbody>" );
251+ str .append ("<tbody>" );
248252
249253 str .append ("<tr><td colspan=\" 5\" >All figures are " +pollInterval +" second(s) delayed and do not include HTTP overhead</td></tr>" );
250254
251255 str .append ("<tr><td colspan=\" 5\" >The cache hit ratio does not account for metatiling</td></tr>" );
256+
257+ str .append ("</tbody>" );
258+
252259 }
253-
260+
254261 return str .toString ();
255262 }
256263
@@ -305,11 +312,11 @@ private String formatBits(double bitsps) {
305312 String avg ;
306313
307314 if (bitsps > 1000000 ) {
308- avg = (Math .round (bitsps / 100000.0 ) / 10.0 ) + " mbps" ;
315+ avg = (Math .round (bitsps / 100000.0 ) / 10.0 ) + " mbps" ;
309316 } else if (bitsps > 1000 ) {
310- avg = (Math .round (bitsps / 100.0 ) / 10.0 ) + " kbps" ;
317+ avg = (Math .round (bitsps / 100.0 ) / 10.0 ) + " kbps" ;
311318 } else {
312- avg = (Math .round (bitsps * 10.0 ) / 10.0 ) + " bps" ;
319+ avg = (Math .round (bitsps * 10.0 ) / 10.0 ) + " bps" ;
313320 }
314321
315322 return avg ;
0 commit comments