File: stats.html.erb

package info (click to toggle)
thin 1.2.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,252 kB
  • ctags: 531
  • sloc: ruby: 4,529; ansic: 725; sh: 21; makefile: 16
file content (216 lines) | stat: -rw-r--r-- 6,334 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<%#
# Taken from Rack::ShowException
# adapted from Django <djangoproject.com>
# Copyright (c) 2005, the Lawrence Journal-World
# Used under the modified BSD license:
# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="robots" content="NONE,NOARCHIVE" />
  <title>Thin Stats</title>
  <style type="text/css">
    html * { padding:0; margin:0; }
    body * { padding:10px 20px; }
    body * * { padding:0; }
    body { font:small sans-serif; }
    body>div { border-bottom:1px solid #ddd; }
    h1 { font-weight:normal; }
    h2 { margin-bottom:.8em; }
    h2 span { font-size:80%; color:#666; font-weight:normal; }
    h3 { margin:1em 0 .5em 0; }
    h4 { margin:0 0 .5em 0; font-weight: normal; }
    table {
        border:1px solid #ccc; border-collapse: collapse; background:white; }
    tbody td, tbody th { vertical-align:top; padding:2px 3px; }
    thead th {
        padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
        font-weight:normal; font-size:11px; border:1px solid #ddd; }
    tbody th { text-align:right; color:#666; padding-right:.5em; }
    table.vars { margin:5px 0 2px 40px; }
    table.vars td, table.req td { font-family:monospace; }
    table td.code { width:100%;}
    table td.code div { overflow:hidden; }
    table.source th { color:#666; }
    table.source td {
        font-family:monospace; white-space:pre; border-bottom:1px solid #eee; }
    ul.traceback { list-style-type:none; }
    ul.traceback li.frame { margin-bottom:1em; }
    div.context { margin: 10px 0; }
    div.context ol {
        padding-left:30px; margin:0 10px; list-style-position: inside; }
    div.context ol li {
        font-family:monospace; white-space:pre; color:#666; cursor:pointer; }
    div.context ol.context-line li { color:black; background-color:#ccc; }
    div.context ol.context-line li span { float: right; }
    div.commands { margin-left: 40px; }
    div.commands a { color:black; text-decoration:none; }
    #summary { background: #ffc; }
    #summary h2 { font-weight: normal; color: #666; }
    #summary ul#quicklinks { list-style-type: none; margin-bottom: 2em; }
    #summary ul#quicklinks li { float: left; padding: 0 1em; }
    #summary ul#quicklinks>li+li { border-left: 1px #666 solid; }
    #explanation { background:#eee; }
    #template, #template-not-exist { background:#f6f6f6; }
    #template-not-exist ul { margin: 0 0 0 20px; }
    #traceback { background:#eee; }
    #summary table { border:none; background:transparent; }
    #requests { background:#f6f6f6; padding-left:120px; }
    #requests h2, #requests h3 { position:relative; margin-left:-100px; }
    #requests h3 { margin-bottom:-1em; }
    .error { background: #ffc; }
    .specific { color:#cc3300; font-weight:bold; }
  </style>
</head>
<body>

<div id="summary">
  <h1>Server stats</h1>
  <h2><%= Thin::SERVER %></h2>
  <table>
    <tr>
      <th>Uptime</th>
      <td><%= Time.now - @start_time %> sec</td>
    </tr>
    <tr>
      <th>PID</th>
      <td><%=h Process.pid %></td>
    </tr>
  </table>
  
  <% if @last_request %>
    <h3>Jump to:</h3>
    <ul id="quicklinks">
      <li><a href="#get-info">GET</a></li>
      <li><a href="#post-info">POST</a></li>
      <li><a href="#cookie-info">Cookies</a></li>
      <li><a href="#env-info">ENV</a></li>
    </ul>
  <% end %>
</div>

<div id="stats">
  <h2>Requests</h2>
  <h3>Stats</h3>
  <table class="req">
    <tr>
      <td>Requests</td>
      <td><%= @requests %></td>
    </tr>
    <tr>
      <td>Finished</td>
      <td><%= @requests_finished %></td>
    </tr>
    <tr>
      <td>Errors</td>
      <td><%= @requests - @requests_finished %></td>
    </tr>
    <tr>
      <td>Last request</td>
      <td><%= @last_request_time %> sec</td>
    </tr>
  </table>
</div>

<% if @last_request %>
  <div id="requestinfo">
    <h2>Last Request information</h2>

    <h3 id="get-info">GET</h3>
    <% unless @last_request.GET.empty? %>
      <table class="req">
        <thead>
          <tr>
            <th>Variable</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
            <% @last_request.GET.sort_by { |k, v| k.to_s }.each { |key, val| %>
            <tr>
              <td><%=h key %></td>
              <td class="code"><div><%=h val.inspect %></div></td>
            </tr>
            <% } %>
        </tbody>
      </table>
    <% else %>
      <p>No GET data.</p>
    <% end %>

    <h3 id="post-info">POST</h3>
    <% unless @last_request.POST.empty? %>
      <table class="req">
        <thead>
          <tr>
            <th>Variable</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
            <% @last_request.POST.sort_by { |k, v| k.to_s }.each { |key, val| %>
            <tr>
              <td><%=h key %></td>
              <td class="code"><div><%=h val.inspect %></div></td>
            </tr>
            <% } %>
        </tbody>
      </table>
    <% else %>
      <p>No POST data.</p>
    <% end %>


    <h3 id="cookie-info">COOKIES</h3>
    <% unless @last_request.cookies.empty? %>
      <table class="req">
        <thead>
          <tr>
            <th>Variable</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
          <% @last_request.cookies.each { |key, val| %>
            <tr>
              <td><%=h key %></td>
              <td class="code"><div><%=h val.inspect %></div></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    <% else %>
      <p>No cookie data.</p>
    <% end %>

    <h3 id="env-info">Rack ENV</h3>
      <table class="req">
        <thead>
          <tr>
            <th>Variable</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
            <% @last_request.env.sort_by { |k, v| k.to_s }.each { |key, val| %>
            <tr>
              <td><%=h key %></td>
              <td class="code"><div><%=h val %></div></td>
            </tr>
            <% } %>
        </tbody>
      </table>

  </div>
<% end %>

<div id="explanation">
  <p>
    You're seeing this page because you use <code>Thin::Stats</code>.
  </p>
</div>

</body>
</html>