Add google appengine to repo
[frozenviper.git] / google_appengine / google / appengine / ext / appstats / templates / details.html
blob20710aff96f4a890d662fb867e9be4926403a29f
1 {% extends "base.html" %}
2 {% block headstuff %}{% endblock %}
3 {% block content %}
4 {% if not record %}
5 <p>Invalid or stale record key!</p>
6 {% else %}
7 <div class="g-section" id="ae-stats-summary">
8 <dl>
9 <dt>
10 <span class="ae-stats-date">{{record.start_time_formatted}}</span><br>
11 <span class="ae-stats-response ae-stats-response-{{record.http_status}}">
12 {{record.http_status}}
13 </span>
14 </dt>
15 <dd>
16 <a {% ifequal record.http_method 'GET' %}target="_new" title="Resubmit the original request to the server" href="{{record.http_path|escape}}{{record.http_query|escape}}" {% endifequal %}>
17 {{record.http_method|escape}} {{record.http_path|escape}}{{record.http_query|escape}}
18 </a>
19 <br>
20 {{record.user_email|escape}}{% if record.is_admin %}*{% endif %}
21 real={{record.duration_milliseconds}}ms
22 cpu={{record.processor_milliseconds}}ms
23 api={{record.api_milliseconds}}ms
24 overhead={{record.overhead_walltime_milliseconds}}ms
25 </dd>
26 </dl>
27 </div>
30 <div id="ae-stats-details-timeline">
31 <h2>Timeline</h2>
32 <div id="ae-body-timeline">
33 <div id="ae-rpc-chart">[Chart goes here]</div>
34 </div>
35 {% if record.individual_stats_size %}
36 <div id="ae-rpc-traces">
37 <div class="ae-table-title">
38 <div class="g-section g-tpl-50-50 g-split">
39 <div class="g-unit g-first"><h2>RPC Call Traces</h2></div>
40 <div class="g-unit" id="ae-rpc-expand-all"></div>
41 </div>
42 </div>
43 <table cellspacing="0" cellpadding="0" class="ae-table" id="ae-table-rpc">
44 <thead>
45 <tr>
46 <th>RPC</th>
47 </tr>
48 </thead>
49 {% for t in record.individual_stats_list %}
50 <tbody id="rpc{{forloop.counter}}">
51 <tr>
52 <td>
53 <span class="goog-inline-block ae-zippy ae-zippy-expand" id="ae-path-requests-{{forloop.counter}}"></span>
54 @{{t.start_offset_milliseconds}}ms
55 <b>{{t.service_call_name|escape}}</b>
56 real={{t.duration_milliseconds}}ms
57 api={{t.api_milliseconds}}ms
58 </td>
59 </tr>
60 </tbody>
61 <tbody>
62 {% if t.request_data_summary %}
63 <tr>
64 <td style="padding-left: 20px"><b>Request:</b> {{t.request_data_summary|escape}}</td>
65 </tr>
66 {% endif %}
67 {% if t.response_data_summary %}
68 <tr>
69 <td style="padding-left: 20px"><b>Response:</b> {{t.response_data_summary|escape}}</td>
70 </tr>
71 {% endif %}
72 {% if t.call_stack_size %}
73 <tr>
74 <td style="padding-left: 20px"><b>Stack:</b></td>
75 </tr>
76 {% for f in t.call_stack_list %}
77 <tr>
78 <td style="padding-left: 40px">
79 <span style="padding-left: 12px; text-indent: -12px" class="goog-inline-block ae-zippy-expand" id="ae-head-stack-{{forloop.parentloop.counter}}-{{forloop.counter}}">&nbsp;</span>
80 {% if file_url %}<a href="{{file_url}}?f={{f.class_or_file_name|escape}}&n={{f.line_number}}#n{{f.line_number|add:"-10"}}">{% endif %} {{f.class_or_file_name|escape}}:{{f.line_number}}{% if file_url %}</a>{% endif %} {{f.function_name|escape}}()
81 </td>
82 </tr>
83 {% if f.variables_size %}
84 <tr id="ae-body-stack-{{forloop.parentloop.counter}}-{{forloop.counter}}">
85 <td style="padding-left: 60px">{% for item in f.variables_list %}{{item.key|escape}} = {{item.value|escape}}<br>{% endfor %}
86 </td>
87 </tr>
88 {% endif %}{# f.variables_size #}
89 {% endfor %}{# t.call_stack_list #}
90 {% endif %}{# t.call_stack_size #}
91 </tbody>
92 {% endfor %}{# record.individual_stats_list #}
93 </table>
94 </div>
95 {% endif %}{# traces #}
96 {% endif %}
97 </div>
99 {% if rpcstats_by_count %}
100 <div id="ae-stats-details-rpcstats">
101 <h2>RPC Stats</h2>
102 <table cellspacing="0" cellpadding="0" class="ae-table" id="ae-table-rpcstats">
103 <tbody>
104 <tr>
105 <td>service.call</td>
106 <td align="right">#RPCs</td>
107 <td align="right">real time</td>
108 <td align="right">api time</td>
109 </tr>
110 {% for item in rpcstats_by_count %}
111 <tr>
112 <td>{{item.0|escape}}</td>
113 <td align="right">{{item.1|escape}}</td>
114 <td align="right">{{item.2}}ms</td>
115 <td align="right">{{item.3}}ms</td>
116 </tr>
117 {% endfor %}
118 </tbody>
119 </table>
120 </div>
121 {% endif %}{# rpcstats_by_count #}
123 {% if record.cgi_env_size %}
124 <div id="ae-stats-details-cgienv">
125 <h2>CGI Environment</h2>
126 <table cellspacing="0" cellpadding="0" class="ae-table" id="ae-table-cgienv">
127 <tbody>
128 {% for item in record.cgi_env_list %}
129 <tr>
130 <td align="right" valign="top">{{item.key|escape}}=</td>
131 <td valign="top">{{item.value|escape}}</td>
132 </tr>
133 {% endfor %}
134 </tbody>
135 </table>
136 </div>
137 {% endif %}{# record.cgi_env_size #}
139 {% if sys.path %}
140 <div id="ae-stats-details-syspath">
141 <h2>sys.path</h2>
142 <table cellspacing="0" cellpadding="0" class="ae-table" id="ae-table-syspath">
143 <tbody>
144 <tr>
145 <td colspan="2">
146 <i>Note:</i> sys.path is not saved with the request;
147 this is the <i>current</i> sys.path.
148 </td>
149 </tr>
150 <tr>
151 </tr>
152 {% for item in sys.path %}
153 <tr>
154 <td align="right" valign="top">{{forloop.counter0}}:</td>
155 <td valign="top">{{item|escape}}</td>
156 </tr>
157 {% endfor %}
158 </tbody>
159 </table>
160 </div>
161 {% endif %}{# sys.path #}
163 {% endblock %}
165 {% block tailstuff %}
166 <script>
167 var rpcZippyMaker = new ae.Stats.MakeZippys('ae-table-rpc',
168 'ae-rpc-expand-all');
169 var rpcZippys = rpcZippyMaker.getZippys();
170 {% for t in record.individual_stats_list %}
171 {% for f in t.call_stack_list %}
172 {% if f.variables_size %}
173 new goog.ui.Zippy(
174 'ae-head-stack-{{forloop.parentloop.counter}}-{{forloop.counter}}',
175 'ae-body-stack-{{forloop.parentloop.counter}}-{{forloop.counter}}',
176 false);
177 {% endif %}
178 {% endfor %}
179 {% endfor %}
180 </script>
181 <script>
182 var detailsTabs_ = new ae.Stats.Details.Tabs(['timeline', 'rpcstats',
183 'cgienv', 'syspath']);
184 </script>
185 <script>
186 function timelineClickHandler(zippyIndex, hash) {
187 rpcZippyMaker.getExpandCollapse().setExpanded(false);
188 rpcZippys[zippyIndex].setExpanded(true);
190 var headlineIndex = parseInt(zippyIndex, 10) + 1;
191 var zippyLine = document.getElementById('ae-path-requests-' + headlineIndex);
192 zippyLine.scrollIntoView(true);
194 function renderChart() {
195 var chart = new Gantt();
196 {% for t in record.individual_stats_list %}
197 chart.add_bar('{{t.service_call_name|escape}}',
198 {{t.start_offset_milliseconds}}, {{t.duration_milliseconds}},
199 {{t.api_milliseconds}},
200 '{{t.duration_milliseconds}}ms{% if t.api_milliseconds %} ({{t.api_milliseconds}}ms api){% endif %}',
201 'javascript:timelineClickHandler(\'{{forloop.counter0}}\');');
202 {% endfor %}
204 chart.add_bar('<b>RPC Total</b>', 0, {{real_total}}, {{api_total}},
205 '{{real_total}}ms{% if api_total %} ({{api_total}}ms api){% endif %}',
206 '');
207 chart.add_bar('<b>Grand Total</b>', 0, {{record.duration_milliseconds}},
208 {{charged_total}},
209 '{{record.duration_milliseconds}}ms{% if charged_total %} ({{charged_total}}ms cpu+api){% endif %}', '');
210 document.getElementById('ae-rpc-chart').innerHTML = chart.draw();
212 renderChart();
213 </script>
214 {% endblock %}