1 |
torben |
1080 |
<%@ page language="java" contentType="text/html; charset=UTF-8" |
2 |
|
|
pageEncoding="UTF-8"%> |
3 |
|
|
<%@ page import="java.util.Date" %> |
4 |
|
|
<%@ page import="dk.thoerup.traininfoservice.Statistics" %> |
5 |
|
|
<%@page import="java.text.NumberFormat"%> |
6 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
7 |
|
|
|
8 |
|
|
<html> |
9 |
|
|
<head> |
10 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
11 |
|
|
<title>TrainInfoService statistics</title> |
12 |
|
|
<style type="text/css"> |
13 |
|
|
td {text-align: right} |
14 |
|
|
td.left {text-align: left} |
15 |
|
|
|
16 |
|
|
</style> |
17 |
|
|
</head> |
18 |
|
|
<body> |
19 |
|
|
<h2>TrainInfoService statistics</h2> |
20 |
|
|
|
21 |
|
|
<% |
22 |
|
|
Statistics stats = Statistics.getInstance(); |
23 |
|
|
double days = stats.getElapsedDays(); |
24 |
|
|
NumberFormat form = NumberFormat.getNumberInstance(); |
25 |
|
|
form.setMaximumFractionDigits(1); |
26 |
|
|
form.setMinimumFractionDigits(1); |
27 |
|
|
|
28 |
|
|
%> |
29 |
|
|
|
30 |
|
|
<table border="0"> |
31 |
|
|
<tr> |
32 |
|
|
<td class="left">Current time:</td> |
33 |
|
|
<td><%= new Date().toString() %></td> |
34 |
|
|
</tr> |
35 |
|
|
<tr> |
36 |
|
|
<td class="left">Last reset:</td> |
37 |
|
|
<td><%= stats.getLastReset().toString() %></td> |
38 |
|
|
</tr> |
39 |
|
|
<tr> |
40 |
|
|
<td class="left">Elapsed</td> |
41 |
|
|
<td><%= stats.getElapsedAsString() %></td> |
42 |
|
|
</tr> |
43 |
|
|
</table> |
44 |
|
|
|
45 |
|
|
<br> |
46 |
|
|
<table border="1" cellspacing="0"> |
47 |
|
|
<tr> |
48 |
|
|
<th> Label </th> |
49 |
|
|
<th> Total </th> |
50 |
|
|
<th> Avg/day </th> |
51 |
|
|
</tr> |
52 |
|
|
<tr> |
53 |
|
|
<td class="left">Station Lookups</td> |
54 |
|
|
<td><%= stats.getStationTotals() %></td> |
55 |
|
|
<td><%= form.format(stats.getStationTotals()/days) %></td> |
56 |
|
|
</tr> |
57 |
|
|
<tr> |
58 |
|
|
<td class="left">--by Location</td> |
59 |
|
|
<td><%= stats.getStationLookupsLocation() %></td> |
60 |
|
|
<td><%= form.format(stats.getStationLookupsLocation()/days) %></td> |
61 |
|
|
</tr> |
62 |
|
|
<tr> |
63 |
|
|
<td class="left">--by Name</td> |
64 |
|
|
<td><%= stats.getStationLookupsName() %></td> |
65 |
|
|
<td><%= form.format(stats.getStationLookupsName()/days) %></td> |
66 |
|
|
</tr> |
67 |
|
|
<tr> |
68 |
|
|
<td class="left">--by Favorites</td> |
69 |
|
|
<td><%= stats.getStationLookupsFavorites() %></td> |
70 |
|
|
<td><%= form.format(stats.getStationLookupsFavorites()/days) %></td> |
71 |
|
|
</tr> |
72 |
|
|
<tr> |
73 |
|
|
<td class="left">Departure Lookups</td> |
74 |
|
|
<td><%= stats.getDepartureLookups() %></td> |
75 |
|
|
<td><%= form.format(stats.getDepartureLookups()/days) %></td> |
76 |
|
|
</tr> |
77 |
|
|
<tr> |
78 |
|
|
<td class="left">--cache hits</td> |
79 |
|
|
<td><%= stats.getDepartureCacheHits() %></td> |
80 |
|
|
<td><%= form.format(stats.getDepartureCacheHits()/days) %></td> |
81 |
|
|
</tr> |
82 |
|
|
<tr> |
83 |
|
|
<td class="left">--failed</td> |
84 |
|
|
<td><%= stats.getDepartureErrors() %></td> |
85 |
|
|
<td><%= form.format(stats.getDepartureErrors()/days) %></td> |
86 |
|
|
</tr> |
87 |
|
|
<tr> |
88 |
|
|
<td class="left">Timetable Lookups</td> |
89 |
|
|
<td><%= stats.getTimetableLookups() %></td> |
90 |
|
|
<td><%= form.format(stats.getTimetableLookups()/days) %></td> |
91 |
|
|
</tr> |
92 |
|
|
<tr> |
93 |
|
|
<td class="left">--cache hits</td> |
94 |
|
|
<td><%= stats.getTimetableCacheHits() %></td> |
95 |
|
|
<td><%= form.format(stats.getTimetableCacheHits()/days) %></td> |
96 |
|
|
</tr> |
97 |
|
|
<tr> |
98 |
|
|
<td class="left">--failed</td> |
99 |
|
|
<td><%= stats.getTimetableErrors() %></td> |
100 |
|
|
<td><%= form.format(stats.getTimetableErrors()/days) %></td> |
101 |
|
|
</tr> |
102 |
|
|
</table> |
103 |
|
|
|
104 |
|
|
<h2>Persistant statistics</h2> |
105 |
|
|
<a href="SavedStatistics">Saved stats</a><br> |
106 |
|
|
</body> |
107 |
|
|
</html> |