blob: 0d8bb07ba1260f4ff27b0d9f53e471ca4b97d16d [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
{{> www/common-header.tmpl }}
{{> www/query_detail_tabs.tmpl }}
<br/>
{{?backend_states}}
<div>
<label>
<input type="checkbox" checked="true" id="toggle" onClick="toggleRefresh()"/>
<span id="refresh_on">Auto-refresh on</span>
</label> Last updated: <span id="last-updated"></span>
</div>
<br/>
<table id="backends" class='table table-hover table-bordered'>
<thead>
<tr>
<th>Host</th>
<th>Num. instances</th>
<th>Num. remaining instances</th>
<th>Done</th>
<th>Peak per-host mem. consumption</th>
<th>Scan bytes read</th>
<th>User CPU(s)</th>
<th>Kernel CPU(s)</th>
<th>Time since last report (ms)</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
var intervalId = 0;
var table = null;
var refresh = function () {
table.ajax.reload();
document.getElementById("last-updated").textContent = new Date();
};
$(document).ready(function() {
table = $('#backends').DataTable({
ajax: { url: make_url("/query_backends?query_id={{query_id}}&json"),
dataSrc: "backend_states",
},
"columns": [ {data: 'host'},
{data: 'num_instances'},
{data: 'num_remaining_instances'},
{data: 'done'},
{data: 'peak_per_host_mem_consumption', render: renderSize},
{data: 'bytes_read', render: renderSize},
{data: 'cpu_user_s'},
{data: 'cpu_sys_s'},
{data: 'time_since_last_heard_from'}],
"order": [[ 0, "desc" ]],
"pageLength": 100
});
intervalId = setInterval( refresh, 1000 );
});
function toggleRefresh() {
if (document.getElementById("toggle").checked == true) {
intervalId = setInterval(refresh, 1000);
document.getElementById("refresh_on").textContent = "Auto-refresh on";
} else {
clearInterval(intervalId);
document.getElementById("refresh_on").textContent = "Auto-refresh off";
}
}
</script>
{{/backend_states}}
{{^backend_states}}
<div class="alert alert-info" role="alert">
Query <strong>{{query_id}}</strong> has either completed or has no backends or has not
started any backends yet.
</div>
{{/backend_states}}
<script>
$("#backends-tab").addClass("active");
</script>
{{> www/common-footer.tmpl }}