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