http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/resources/tservers.js ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/resources/tservers.js b/server/monitor/src/main/resources/resources/tservers.js deleted file mode 100644 index 7f19c2d..0000000 --- a/server/monitor/src/main/resources/resources/tservers.js +++ /dev/null @@ -1,324 +0,0 @@ -/* -* 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. -*/ - -/** - * Creates tservers initial table - */ -$(document).ready(function() { - createHeader(); - refreshTServers(); -}); - -/** - * Makes the REST calls, generates the tables with the new information - */ -function refreshTServers() { - $.ajaxSetup({ - async: false - }); - getTServers(); - $.ajaxSetup({ - async: true - }); - refreshBadTServersTable(); - refreshDeadTServersTable(); - refreshTServersTable(); -} - -/** - * Used to redraw the page - */ -function refresh() { - refreshTServers(); -} - -/** - * Generates the tservers table - */ -function refreshBadTServersTable() { - var data = sessionStorage.tservers === undefined ? - [] : JSON.parse(sessionStorage.tservers); - - $('#badtservers tr').remove(); - $('#badtservers caption').remove(); - - if (data.length === 0 || data.badServers.length === 0) { - - $('#badtservers').hide(); - } else { - - $('#badtservers').show(); - - var caption = []; - - caption.push('<span class="table-caption">Non-Functioning ' + - 'Tablet Servers</span><br />'); - caption.push('<span class="table-subcaption">The following tablet' + - ' servers reported a status other than Online</span><br />'); - - $('<caption/>', { - html: caption.join('') - }).appendTo('#badtservers'); - - var items = []; - - items.push('<th class="firstcell" onclick="sortTable(0,0)">' + - 'Tablet Server </th>'); - items.push('<th onclick="sortTable(0,1)">Tablet Server ' + - 'Status </th>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#badtservers'); - - $.each(data.badServers, function(key, val) { - var items = []; - items.push('<td class="firstcell left" data-value="' + val.id + - '">' + val.id + '</td>'); - items.push('<td class="right" data-value="' + val.status + - '">' + val.status + '</td>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#badtservers'); - }); - } -} - -/** - * Generates the deadtservers table - */ -function refreshDeadTServersTable() { - var data = sessionStorage.tservers === undefined ? - [] : JSON.parse(sessionStorage.tservers); - - $('#deadtservers tr').remove(); - $('#deadtservers caption').remove(); - - if (data.length === 0 || data.deadServers.length === 0) { - - $('#deadtservers').hide(); - } else { - - $('#deadtservers').show(); - - - var caption = []; - - caption.push('<span class="table-caption">Dead ' + - 'Tablet Servers</span><br />'); - caption.push('<span class="table-subcaption">The following' + - ' tablet servers are no longer reachable.</span><br />'); - - $('<caption/>', { - html: caption.join('') - }).appendTo('#deadtservers'); - - var items = []; - - items.push('<th class="firstcell" onclick="sortTable(1,0)">' + - 'Server </th>'); - items.push('<th onclick="sortTable(1,1)">Last Updated </th>'); - items.push('<th onclick="sortTable(1,2)">Event </th>'); - items.push('<th>Clear</th>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#deadtservers'); - - $.each(data.deadServers, function(key, val) { - var items = []; - items.push('<td class="firstcell left" data-value="' + val.server + - '">' + val.server + '</td>'); - - var date = new Date(val.lastStatus); - date = date.toLocaleString().split(' ').join(' '); - items.push('<td class="right" data-value="' + val.lastStatus + - '">' + date + '</td>'); - items.push('<td class="right" data-value="' + val.status + - '">' + val.status + '</td>'); - items.push('<td class="right"> ' + - '<a href="javascript:clearDeadTServers(\'' + - val.server + '\');">clear</a></td>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#deadtservers'); - }); - } -} - -/** - * Makes the REST POST call to clear dead table server - * - * @param {string} server Dead TServer to clear - */ -function clearDeadTServers(server) { - clearDeadServers(server); - refreshTServers(); - refreshNavBar(); -} - -/** - * Generates the tserver table - */ -function refreshTServersTable() { - var data = sessionStorage.tservers === undefined ? - [] : JSON.parse(sessionStorage.tservers); - - $('#tservers tr:gt(0)').remove(); - - if (data.length === 0 || data.servers.length === 0) { - var item = '<td class="center" colspan="13"><i>Empty</i></td>'; - - $('<tr/>', { - html: item - }).appendTo('#tservers'); - } else { - - $.each(data.servers, function(key, val) { - var items = []; - items.push('<td class="firstcell left" data-value="' + val.hostname + - '"><a href="/tservers?s=' + val.id + '">' + val.hostname + - '</a></td>'); - - items.push('<td class="right" data-value="' + val.tablets + - '">' + bigNumberForQuantity(val.tablets) + '</td>'); - - items.push('<td class="right" data-value="' + val.lastContact + - '">' + timeDuration(val.lastContact) + '</td>'); - - items.push('<td class="right" data-value="' + val.entries + - '">' + bigNumberForQuantity(val.entries) + '</td>'); - - items.push('<td class="right" data-value="' + val.ingest + - '">' + bigNumberForQuantity(Math.floor(val.ingest)) + '</td>'); - - items.push('<td class="right" data-value="' + val.query + - '">' + bigNumberForQuantity(Math.floor(val.query)) + '</td>'); - - items.push('<td class="right" data-value="' + val.holdtime + - '">' + timeDuration(val.holdtime) + '</td>'); - - items.push('<td class="right" data-value="' + - (val.compactions.scans.running + val.compactions.scans.queued) + - '">' + bigNumberForQuantity(val.compactions.scans.running) + - ' (' + bigNumberForQuantity(val.compactions.scans.queued) + - ')</td>'); - - items.push('<td class="right" data-value="' + - (val.compactions.minor.running + val.compactions.minor.queued) + - '">' + bigNumberForQuantity(val.compactions.minor.running) + - ' (' + bigNumberForQuantity(val.compactions.minor.queued) + - ')</td>'); - - items.push('<td class="right" data-value="' + - (val.compactions.major.running + val.compactions.major.queued) + - '">' + bigNumberForQuantity(val.compactions.major.running) + - ' (' + bigNumberForQuantity(val.compactions.major.queued) + - ')</td>'); - - items.push('<td class="right" data-value="' + - val.indexCacheHitRate * 100 + '">' + - Math.round(val.indexCacheHitRate * 100) + - '%</td>'); - - items.push('<td class="right" data-value="' + val.dataCacheHitRate * 100 + - '">' + Math.round(val.dataCacheHitRate * 100) + - '%</td>'); - - items.push('<td class="right" data-value="' + val.osload + - '">' + bigNumberForQuantity(val.osload) + '</td>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#tservers'); - }); - } -} - -/** - * Sorts the tservers table on the selected column - * - * @param {string} table Table ID to sort - * @param {number} n Column number to sort by - */ -function sortTable(table, n) { - var tableIDs = ['badtservers', 'deadtservers', 'tservers']; - - if (sessionStorage.tableColumnSort !== undefined && - sessionStorage.tableColumnSort == n && - sessionStorage.direction !== undefined) { - direction = sessionStorage.direction === 'asc' ? 'desc' : 'asc'; - } else { - direction = sessionStorage.direction === undefined ? - 'asc' : sessionStorage.direction; - } - sessionStorage.tableColumn = tableIDs[table]; - sessionStorage.tableColumnSort = n; - sortTables(tableIDs[table], direction, n); -} - -/** - * Creates the tservers header - */ -function createHeader() { - var caption = []; - - caption.push('<span class="table-caption">Tablet Servers</span><br />'); - caption.push('<span class="table-subcaption">Click on the ' + - '<span style="color: #0000ff;">server address</span> to ' + - 'view detailed performance statistics for that server.</span><br />'); - - $('<caption/>', { - html: caption.join('') - }).appendTo('#tservers'); - - var items = []; - - items.push('<th class="firstcell" onclick="sortTable(2,0)">Server </th>'); - items.push('<th onclick="sortTable(2,1)">Hosted Tablets </th>'); - items.push('<th onclick="sortTable(2,2)">Last Contact </th>'); - items.push('<th onclick="sortTable(2,3)" title="' + - descriptions['Entries'] + '">Entries </th>'); - items.push('<th onclick="sortTable(2,4)" title="' + - descriptions['Ingest'] + '">Ingest </th>'); - items.push('<th onclick="sortTable(2,5)" title="' + - descriptions['Query'] + '">Query </th>'); - items.push('<th onclick="sortTable(2,6)" title="' + - descriptions['Hold Time'] + '">Hold Time </th>'); - items.push('<th onclick="sortTable(2,7)" title="' + - descriptions['Running Scans'] + '">Running<br />Scans </th>'); - items.push('<th onclick="sortTable(2,8)" title="' + - descriptions['Minor Compactions'] + - '">Minor<br />Compactions </th>'); - items.push('<th onclick="sortTable(2,9)" title="' + - descriptions['Major Compactions'] + - '">Major<br />Compactions </th>'); - items.push('<th onclick="sortTable(2,10)" title="' + - descriptions['Index Cache Hit Rate'] + - '">Index Cache<br />Hit Rate </th>'); - items.push('<th onclick="sortTable(2,11)" title="' + - descriptions['Data Cache Hit Rate'] + - '">Data Cache<br />Hit Rate </th>'); - items.push('<th onclick="sortTable(2,12)" title="' + - descriptions['OS Load'] + '">OS Load </th>'); - - $('<tr/>', { - html: items.join('') - }).appendTo('#tservers'); -}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/resources/up.gif ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/resources/up.gif b/server/monitor/src/main/resources/resources/up.gif deleted file mode 100644 index b272cbb..0000000 Binary files a/server/monitor/src/main/resources/resources/up.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/resources/vis.js ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/resources/vis.js b/server/monitor/src/main/resources/resources/vis.js deleted file mode 100644 index bcf5327..0000000 --- a/server/monitor/src/main/resources/resources/vis.js +++ /dev/null @@ -1,506 +0,0 @@ -/* - * 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. - */ - -// Server Stats -var statNames = {}, maxStatValues = {}, adjustMax = {}, significance = {}; - -/** - * Sets the options for the server visualization - * - * @param {string} shape Circle or Square - * @param {number} size Size of shape - * @param {string} motion Stat to display motion - * @param {string} color Stat to display color - */ -function setOptions(shape, size, motion, color) { - var data = sessionStorage.serverStats === undefined ? - {} : JSON.parse(sessionStorage.serverStats); - $('#motion').empty(); - $('#color').empty(); - - $.each(data.serverStats, function(key, val) { - var item = val.description; - - $('#motion').append('<option ' + (motion === val.name ? 'selected' : '') + - '>' + item + '</option>'); - $('#color').append('<option ' + (color === val.name ? 'selected' : '') + - '>' + item + '</option>'); - - }); - if (speedStatType === undefined) { - speedStatType = motion !== undefined || motion !== '' ? motion : ''; - speedDisabled = motion !== '' ? false : true; - } - if (speedStatType !== motion && motion !== undefined && - motion !== 'osload' && motion !== '') { - speedStatType = motion; - speedDisabled = false; - } - if (colorStatType === undefined) { - colorStatType = color !== undefined ? color : 'osload'; - } - if (colorStatType !== color && color !== undefined) { - colorStatType = color; - } -} - -/** - * Sets the stats values from the REST call - */ -function setStats() { - - var data = JSON.parse(sessionStorage.serverStats); - - $.each(data.serverStats, function(key, val) { - statNames[val.name] = val.derived; - maxStatValues[val.name] = val.max; - adjustMax[val.name] = val.adjustMax; - significance[val.name] = val.significance; - }); - - var numNormalStats = 8; -} - -// size and spacing variables -var dotSpacing = 10; // spacing between centers of dots (radius) -var dotPadding = 0.5; // dot padding -var minDotRadius = 3; // min dot radius -var maxDotRadius = dotSpacing - dotPadding; - -// arrays of information about each dot -var stats = {'servers': []}; -var dots = new Array(0); // current sizes and change directions -var mousedDot = -1; // the dot currently under the mouse - -var colorPalette = ['#0000CC', '#0014B8', '#0029A3', '#003D8F', '#00527A', - '#006666', '#007A52', '#008F3D', '#00A329', '#00B814', '#00CC00', - '#14D100', '#29D600', '#3DDB00', '#52E000', '#66E600', '#7AEB00', - '#8FF000', '#A3F500', '#B8FA00', '#CCFF00', '#CCFF00', '#CCF200', - '#CCE600', '#CCD900', '#CCCC00', '#CCBF00', '#CCB200', '#CCA600', - '#CC9900', '#CC8C00', '#CC8000', '#CC7300', '#CC6600', '#CC5900', - '#CC4C00', '#CC4000', '#CC3300', '#CC2600', '#CC1A00', '#CC0D00', - '#CC0000']; - -var nullColor = '#F5F8FA'; -var deadColor = '#B000CC'; - -// animation variables -var drawing = false; -var canvas = document.getElementById('visCanvas'); -var context = canvas.getContext('2d'); - -// mouse handling for server information display -document.getElementById('hoverable').addEventListener('mouseover', - showId, false); -document.getElementById('hoverable').addEventListener('mousemove', - showId, false); -document.getElementById('hoverable').addEventListener('mouseout', - hideId, false); -document.getElementById('vishoverinfo').addEventListener('click', - goToServer, false); -canvas.addEventListener('click', goToServer, false); - -// initialize settings based on request parameters -var main = document.getElementById('main'); -var speedStatType; -var colorStatType; -var speedDisabled = true; -var useCircles = true; -setShape(document.getElementById('shape')); -setSize(document.getElementById('size')); -setMotion(document.getElementById('motion')); -setColor(document.getElementById('color')); - -// xml loading variables -var xmlReturned = true; -// don't bother allowing for IE 5 or 6 since canvas won't work -var xmlhttp = new XMLHttpRequest(); -xmlhttp.onreadystatechange = function() { - handleNewData(); -}; - -self.setInterval('getXML()', 5000); - -//self.setInterval('drawDots()',20); - -window.requestAnimFrame = (function(callback) { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(callback) { - window.setTimeout(callback, 1000 / 60); - }; -})(); - -function handleNewData() { - if (xmlhttp.readyState != 4) { - return; - } - if (xmlhttp.status != 200 || xmlhttp.responseText == null) { - xmlReturned = true; - return; - } - var newstats = JSON.parse(xmlhttp.responseText); - for (var i in newstats.servers) { - for (var s in statNames) { - if (statNames[s]) - continue; - newstats.servers[i][s] = Math.max(0, Math.floor(significance[s] * - newstats.servers[i][s]) / significance[s]); - if (adjustMax[s]) - maxStatValues[s] = Math.max(newstats.servers[i][s], maxStatValues[s]); - } - } - - initDerivedInfo(newstats); - var oldstats = stats; - while (drawing) {} - stats = newstats; - delete oldstats; - xmlReturned = true; -} - -// set max and average -function setDerivedStats(serverStats) { - var avgStat = 0; - var maxStat = 0; - var maxIndex = 0; - for (var s in statNames) { - if (statNames[s]) - continue; - normStat = serverStats[s] / maxStatValues[s]; - if (normStat > 0) - avgStat += normStat; - if (maxStat < normStat) { - maxStat = normStat; - maxIndex = s; - } - } - serverStats.allmax = Math.floor(significance.allmax * - Math.min(1, maxStat)) / significance.allmax; - serverStats.allavg = Math.floor(significance.allavg * - avgStat / numNormalStats) / significance.allavg; - serverStats.maxStat = maxIndex; -} - -function initDerivedInfo(newstats) { - for (var i in newstats.servers) { - if ('dead' in newstats.servers[i] || 'bad' in newstats.servers[i]) { - continue; - } - if (i >= dots.length) { - dots.push({'size': maxDotRadius, 'growing': false}); - } - setDerivedStats(newstats.servers[i]); - } -} - -// construct server info for hover -function getInfo(serverStats) { - var extra = '<strong>' + serverStats.ip + '</strong>'; - if ('dead' in serverStats || 'bad' in serverStats) - return extra; - extra = extra + ' (' + serverStats.hostname + ')'; - var j = 0; - for (var s in statNames) { - if (j % 4 == 0) - extra = extra + '<br>\n'; - extra = extra + ' ' + s + ': <strong>' + - serverStats[s] + '</strong>'; - j++; - } - extra = extra + ' (' + serverStats.maxStat + ')'; - return extra; -} - -// reload xml -function getXML() { - if (xmlReturned == true) { - xmlReturned = false; - xmlhttp.open('GET', jsonurl, true); - xmlhttp.send(); - } -} - -// redraw -function drawDots() { - requestAnimFrame(drawDots); - var width = Math.ceil(Math.sqrt(stats.servers.length)); - var height = Math.ceil(stats.servers.length / width); - var x; - var y; - var server; - var sizeChange; - drawing = true; - for (var i in stats.servers) { - server = stats.servers[i]; - x = i % width; - y = Math.floor(i / width); - if ('bad' in server || 'dead' in server) { - strokeDot(x, y, maxDotRadius - 1, deadColor); - continue; - } - if (speedDisabled || Math.floor(dots[i].size) > maxDotRadius) { - // check for resize by the user - dots[i].size = maxDotRadius; - } else if (server[speedStatType] <= 0) { - // if not changing size, increase to max radius - if (dots[i].size < maxDotRadius) - dots[i].size = dots[i].size + 1; - if (dots[i].size > maxDotRadius) - dots[i].size = maxDotRadius; - } else { - sizeChange = getStat(i, speedStatType); - if (dots[i].growing) { - dots[i].size = dots[i].size + sizeChange; - if (dots[i].size + sizeChange > maxDotRadius) { - dots[i].growing = false; - } - } - else { - dots[i].size = dots[i].size - sizeChange; - if (dots[i].size - sizeChange < minDotRadius) { - dots[i].growing = true; - } - } - } - drawDot(x, y, Math.floor(dots[i].size), - getColor(getStat(i, colorStatType))); - } - /* - * mousedDot shouldn't be set to an invalid dot, - * but stats might have changed since then - */ - if (mousedDot >= 0 && mousedDot < stats.servers.length) - document.getElementById('vishoverinfo').innerHTML = - getInfo(stats.servers[mousedDot]); - drawing = false; -} - -// fill in a few grey dots -function drawGrid() { - context.clearRect(0, 0, canvas.width, canvas.height); - for (var i = 0, k = 0; i < canvas.width; i += dotSpacing * 2, k++) { - for (var j = 0, l = 0; j < canvas.height; j += dotSpacing * 2, l++) { - drawDot(k, l, maxDotRadius, nullColor); - } - } -} - -// fill a dot specified by indices into dot grid -function drawDot(i, j, r, c) { - var x = i * dotSpacing * 2 + dotSpacing; - var y = j * dotSpacing * 2 + dotSpacing; - context.clearRect(x - dotSpacing, y - dotSpacing, dotSpacing * 2, - dotSpacing * 2); - if (useCircles) - fillCircle(x, y, r - dotPadding, c); - else - fillSquare(x - r, y - r, (r - dotPadding) * 2, c); -} - -// stroke a dot specified by indices into dot grid -function strokeDot(i, j, r, c) { - var x = i * dotSpacing * 2 + dotSpacing; - var y = j * dotSpacing * 2 + dotSpacing; - context.clearRect(x - dotSpacing, y - dotSpacing, dotSpacing * 2, - dotSpacing * 2); - if (useCircles) - strokeCircle(x, y, r - dotPadding, c); - else - strokeSquare(x - r, y - r, (r - dotPadding) * 2, c); -} - -function getStat(dotIndex, statIndex) { - return Math.min(1, stats.servers[dotIndex][statIndex] / - maxStatValues[statIndex]); -} - -// translate color between 0 and maxObservedColor into an html color code -function getColor(normColor) { - return colorPalette[Math.round((colorPalette.length - 1) * normColor)]; -} - -function strokeCircle(x, y, r, c) { - context.strokeStyle = c; - context.lineWidth = 2; - context.beginPath(); - context.arc(x, y, r, 0, Math.PI * 2, true); - context.closePath(); - context.stroke(); -} - -function fillCircle(x, y, r, c) { - context.fillStyle = c; - context.beginPath(); - context.arc(x, y, r, 0, Math.PI * 2, true); - context.closePath(); - context.fill(); -} - -function strokeSquare(x, y, d, c) { - context.strokeStyle = c; - context.lineWidth = 2; - context.strokeRect(x, y, d, d); -} - -function fillSquare(x, y, d, c) { - context.fillStyle = c; - context.fillRect(x, y, d, d); -} - -// callback for shape selection -function setShape(obj) { - switch (obj.selectedIndex) { - case 0: - useCircles = true; - break; - case 1: - useCircles = false; - break; - default: - useCircles = true; - } - drawGrid(); - setState(); -} - -// callback for size selection -function setSize(obj) { - switch (obj.selectedIndex) { - case 0: - dotSpacing = 5; - minDotRadius = 1; - break; - case 1: - dotSpacing = 10; - minDotRadius = 3; - break; - case 2: - dotSpacing = 20; - minDotRadius = 5; - break; - case 3: - dotSpacing = 40; - minDotRadius = 7; - break; - default: - dotSpacing = 10; - minDotRadius = 3; - } - maxDotRadius = dotSpacing - dotPadding; - drawGrid(); - setState(); -} - -// callback for motion selection -function setMotion(obj) { - if (obj.selectedIndex <= 0) { - speedDisabled = true; - setState(); - return; - } - var i = 0; - for (var s in statNames) { - if (i == obj.selectedIndex) { - speedStatType = s; - break; - } - i++; - } - speedDisabled = false; - setState(); -} - -// callback for color selection -function setColor(obj) { - var i = 0; - for (var s in statNames) { - if (i == obj.selectedIndex) { - colorStatType = s; - break; - } - i++; - } - setState(); -} - -// hide server info on mouseout -function hideId(e) { - document.getElementById('vishoverinfo').style.visibility = 'hidden'; -} - -// display server info on mouseover -function showId(e) { - var x; - var y; - if (e.pageX || e.pageY) { - x = e.pageX + main.scrollLeft; - y = e.pageY + main.scrollTop; - } - else { - // clientX and clientY unimplemented - return; - } - var relx = x - canvas.offsetLeft - main.offsetLeft; - var rely = y - canvas.offsetTop - main.offsetTop; - var width = Math.ceil(Math.sqrt(stats.servers.length)); - gotDot = Math.floor(relx / (dotSpacing * 2)) + width * - Math.floor(rely / (dotSpacing * 2)); - mousedDot = -1; - if (relx < (width * dotSpacing * 2) && gotDot >= 0 && - gotDot < stats.servers.length) { - mousedDot = gotDot; - document.getElementById('vishoverinfo').style.left = relx + - canvas.offsetLeft; - document.getElementById('vishoverinfo').style.top = Math.max(0, - rely + canvas.offsetTop - 70); - document.getElementById('vishoverinfo').style.visibility = 'visible'; - } - else { - document.getElementById('vishoverinfo').style.visibility = 'hidden'; - } -} - -function setState() { - var url = visurl + '?shape=' + (useCircles ? 'circles' : 'squares') + - '&size=' + (dotSpacing * 2) + (speedDisabled ? '' : - '&motion=' + speedStatType) + - '&color=' + colorStatType; - window.history.replaceState(window.history.state, 'Server Activity', url); - - setOptions(useCircles ? 'circles' : 'squares', dotSpacing * 2, - speedDisabled ? '' : speedStatType, colorStatType); -} - -// go to server page on click -function goToServer(e) { - /* - * mousedDot shouldn't be set to an invalid dot, - * but stats might have changed since then - */ - if (mousedDot >= 0 && mousedDot < stats.servers.length) - window.location = serverurl + stats.servers[mousedDot].ip; -} - -/*window.onload = function() { - drawGrid(); - drawDots(); - getXML(); -}*/ http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/resources/vis.js.old ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/resources/vis.js.old b/server/monitor/src/main/resources/resources/vis.js.old deleted file mode 100644 index 8f2bc20..0000000 --- a/server/monitor/src/main/resources/resources/vis.js.old +++ /dev/null @@ -1,409 +0,0 @@ -/* - * 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. - */ - -// size and spacing variables -var dotSpacing = 10; // spacing between centers of dots (radius) -var dotPadding = 0.5; // dot padding -var minDotRadius = 3; // min dot radius -var maxDotRadius = dotSpacing - dotPadding; - -// arrays of information about each dot -var stats = {'servers': []}; -var dots = new Array(0); // current sizes and change directions -var mousedDot = -1; // the dot currently under the mouse - -var colorPalette = ['#0000CC', '#0014B8', '#0029A3', '#003D8F', '#00527A', '#006666', '#007A52', '#008F3D', '#00A329', '#00B814', '#00CC00', '#14D100', '#29D600', '#3DDB00', '#52E000', '#66E600', '#7AEB00', '#8FF000', '#A3F500', '#B8FA00', '#CCFF00', '#CCFF00', '#CCF200', '#CCE600', '#CCD900', '#CCCC00', '#CCBF00', '#CCB200', '#CCA600', '#CC9900', '#CC8C00', '#CC8000', '#CC7300', '#CC6600', '#CC5900', '#CC4C00', '#CC4000', '#CC3300', '#CC2600', '#CC1A00', '#CC0D00', '#CC0000']; - -var nullColor = '#F5F8FA'; -var deadColor = '#B000CC'; - -// animation variables -var drawing = false; -var canvas = document.getElementById('visCanvas'); -var context = canvas.getContext('2d'); - -// mouse handling for server information display -document.getElementById('hoverable').addEventListener('mouseover', showId, false); -document.getElementById('hoverable').addEventListener('mousemove', showId, false); -document.getElementById('hoverable').addEventListener('mouseout', hideId, false); -document.getElementById('vishoverinfo').addEventListener('click', goToServer, false); -canvas.addEventListener('click', goToServer, false); - -// initialize settings based on request parameters -var main = document.getElementById('main'); -var speedStatType; -var colorStatType; -var speedDisabled = true; -var useCircles = true; -setShape(document.getElementById('shape')); -setSize(document.getElementById('size')); -setMotion(document.getElementById('motion')); -setColor(document.getElementById('color')); - -// xml loading variables -var xmlReturned = true; -var xmlhttp=new XMLHttpRequest(); // don't bother allowing for IE 5 or 6 since canvas won't work -xmlhttp.onreadystatechange=function() { - handleNewData(); -} -self.setInterval("getXML()",5000); -//self.setInterval("drawDots()",20); - -window.requestAnimFrame = (function(callback){ - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(callback){ - window.setTimeout(callback, 1000 / 60); - }; -})(); - -function handleNewData() { - if (xmlhttp.readyState!=4) { - return; - } - if (xmlhttp.status!=200 || xmlhttp.responseText==null) { - xmlReturned = true; - return; - } - var newstats = JSON.parse(xmlhttp.responseText); - for (var i in newstats.servers) { - for (var s in statNames) { - if (statNames[s]) - continue; - newstats.servers[i][s] = Math.max(0,Math.floor(significance[s]*newstats.servers[i][s])/significance[s]); - if (adjustMax[s]) - maxStatValues[s] = Math.max(newstats.servers[i][s],maxStatValues[s]); - } - } - - initDerivedInfo(newstats); - var oldstats = stats; - while(drawing) {} - stats = newstats; - delete oldstats; - xmlReturned = true; -} - -// set max and average -function setDerivedStats(serverStats) { - var avgStat = 0; - var maxStat = 0; - var maxIndex = 0; - for (var s in statNames) { - if (statNames[s]) - continue; - normStat = serverStats[s]/maxStatValues[s]; - if (normStat > 0) - avgStat += normStat; - if (maxStat < normStat) { - maxStat = normStat; - maxIndex = s; - } - } - serverStats.allmax = Math.floor(significance.allmax*Math.min(1,maxStat))/significance.allmax; - serverStats.allavg = Math.floor(significance.allavg*avgStat/numNormalStats)/significance.allavg; - serverStats.maxStat = maxIndex; -} - -function initDerivedInfo(newstats) { - for (var i in newstats.servers) { - if ('dead' in newstats.servers[i] || 'bad' in newstats.servers[i]) { - continue; - } - if (i >= dots.length) { - dots.push({'size': maxDotRadius, 'growing': false}); - } - setDerivedStats(newstats.servers[i]); - } -} - -// construct server info for hover -function getInfo(serverStats) { - var extra = '<strong>' + serverStats.ip + '</strong>'; - if ('dead' in serverStats || 'bad' in serverStats) - return extra; - extra = extra + ' (' + serverStats.hostname + ')'; - var j = 0; - for (var s in statNames) { - if (j % 4 == 0) - extra = extra + '<br>\n'; - extra = extra + ' ' + s + ': <strong>' + serverStats[s] + '</strong>'; - j++; - } - extra = extra + ' (' + serverStats.maxStat + ')'; - return extra; -} - -// reload xml -function getXML() { - if (xmlReturned == true) { - xmlReturned = false; - xmlhttp.open('POST',jsonurl,true); - xmlhttp.send(); - } -} - -// redraw -function drawDots() { - requestAnimFrame(drawDots); - - var width = Math.ceil(Math.sqrt(stats.servers.length)); - var height = Math.ceil(stats.servers.length/width); - var x; - var y; - var server - var sizeChange; - drawing = true; - for (var i in stats.servers) { - server = stats.servers[i]; - x = i % width; - y = Math.floor(i / width); - if ('bad' in server || 'dead' in server) { - strokeDot(x,y,maxDotRadius-1,deadColor); - continue; - } - if (speedDisabled || Math.floor(dots[i].size) > maxDotRadius) { - // check for resize by the user - dots[i].size = maxDotRadius; - } else if (server[speedStatType]<=0) { - // if not changing size, increase to max radius - if (dots[i].size < maxDotRadius) - dots[i].size = dots[i].size + 1; - if (dots[i].size > maxDotRadius) - dots[i].size = maxDotRadius; - } else { - sizeChange = getStat(i,speedStatType); - if (dots[i].growing) { - dots[i].size = dots[i].size + sizeChange; - if (dots[i].size + sizeChange > maxDotRadius) { - dots[i].growing = false; - } - } - else { - dots[i].size = dots[i].size - sizeChange; - if (dots[i].size - sizeChange < minDotRadius) { - dots[i].growing = true; - } - } - } - drawDot(x,y,Math.floor(dots[i].size),getColor(getStat(i,colorStatType))); - } - // mousedDot shouldn't be set to an invalid dot, but stats might have changed since then - if (mousedDot >= 0 && mousedDot < stats.servers.length) - document.getElementById('vishoverinfo').innerHTML=getInfo(stats.servers[mousedDot]); - drawing = false; -} - -// fill in a few grey dots -function drawGrid() { - context.clearRect(0, 0, canvas.width, canvas.height); - for (var i=0, k=0; i < canvas.width; i+=dotSpacing*2,k++) { - for (var j=0, l=0; j < canvas.height; j+=dotSpacing*2,l++) { - drawDot(k,l,maxDotRadius,nullColor); - } - } -} - -// fill a dot specified by indices into dot grid -function drawDot(i,j,r,c) { - var x = i*dotSpacing*2 + dotSpacing; - var y = j*dotSpacing*2 + dotSpacing; - context.clearRect(x-dotSpacing, y-dotSpacing, dotSpacing*2, dotSpacing*2); - if (useCircles) - fillCircle(x,y,r-dotPadding,c); - else - fillSquare(x-r,y-r,(r-dotPadding)*2,c); -} - -// stroke a dot specified by indices into dot grid -function strokeDot(i,j,r,c) { - var x = i*dotSpacing*2 + dotSpacing; - var y = j*dotSpacing*2 + dotSpacing; - context.clearRect(x-dotSpacing, y-dotSpacing, dotSpacing*2, dotSpacing*2); - if (useCircles) - strokeCircle(x,y,r-dotPadding,c); - else - strokeSquare(x-r,y-r,(r-dotPadding)*2,c); -} - -function getStat(dotIndex,statIndex) { - return Math.min(1,stats.servers[dotIndex][statIndex]/maxStatValues[statIndex]); -} - -// translate color between 0 and maxObservedColor into an html color code -function getColor(normColor) { - return colorPalette[Math.round((colorPalette.length-1)*normColor)]; -} - -function strokeCircle(x,y,r,c) { - context.strokeStyle = c; - context.lineWidth = 2; - context.beginPath(); - context.arc(x,y,r,0,Math.PI*2,true); - context.closePath(); - context.stroke(); -} - -function fillCircle(x,y,r,c) { - context.fillStyle = c; - context.beginPath(); - context.arc(x,y,r,0,Math.PI*2,true); - context.closePath(); - context.fill(); -} - -function strokeSquare(x,y,d,c) { - context.strokeStyle = c; - context.lineWidth = 2; - context.strokeRect(x,y,d,d); -} - -function fillSquare(x,y,d,c) { - context.fillStyle = c; - context.fillRect(x,y,d,d); -} - -// callback for shape selection -function setShape(obj) { - switch (obj.selectedIndex) { - case 0: - useCircles = true; - break; - case 1: - useCircles = false; - break; - default: - useCircles = true; - } - drawGrid(); - setState(); -} - -// callback for size selection -function setSize(obj) { - switch (obj.selectedIndex) { - case 0: - dotSpacing = 5; - minDotRadius = 1; - break; - case 1: - dotSpacing = 10; - minDotRadius = 3; - break; - case 2: - dotSpacing = 20; - minDotRadius = 5; - break; - case 3: - dotSpacing = 40; - minDotRadius = 7; - break; - default: - dotSpacing = 10; - minDotRadius = 3; - } - maxDotRadius = dotSpacing - dotPadding; - drawGrid(); - setState(); -} - -// callback for motion selection -function setMotion(obj) { - if (obj.selectedIndex==0) { - speedDisabled = true; - setState(); - return; - } - var i = 1; - for (var s in statNames) { - if (i==obj.selectedIndex) { - speedStatType = s; - break; - } - i++; - } - speedDisabled = false; - setState(); -} - -// callback for color selection -function setColor(obj) { - var i = 0; - for (var s in statNames) { - if (i==obj.selectedIndex) { - colorStatType = s; - break; - } - i++; - } - setState(); -} - -// hide server info on mouseout -function hideId(e) { - document.getElementById('vishoverinfo').style.visibility='hidden'; -} - -// display server info on mouseover -function showId(e) { - var x; - var y; - if (e.pageX || e.pageY) { - x = e.pageX + main.scrollLeft; - y = e.pageY + main.scrollTop; - } - else { - // clientX and clientY unimplemented - return; - } - var relx = x - canvas.offsetLeft - main.offsetLeft; - var rely = y - canvas.offsetTop - main.offsetTop; - var width = Math.ceil(Math.sqrt(stats.servers.length)); - gotDot = Math.floor(relx/(dotSpacing*2)) + width*Math.floor(rely/(dotSpacing*2)); - mousedDot = -1; - if (relx < (width*dotSpacing*2) && gotDot >= 0 && gotDot < stats.servers.length) { - mousedDot = gotDot; - document.getElementById('vishoverinfo').style.left=relx+canvas.offsetLeft; - document.getElementById('vishoverinfo').style.top=Math.max(0,rely+canvas.offsetTop-70); - document.getElementById('vishoverinfo').style.visibility='visible'; - } - else { - document.getElementById('vishoverinfo').style.visibility='hidden'; - } -} - -function setState() { - var url = visurl+'?shape='+(useCircles?'circles':'squares')+'&size='+(dotSpacing*2)+(speedDisabled ? '' : '&motion='+speedStatType)+'&color='+colorStatType; - window.history.replaceState(window.history.state,'Server Activity',url); -} - -// go to server page on click -function goToServer(e) { - // mousedDot shouldn't be set to an invalid dot, but stats might have changed since then - if (mousedDot >= 0 && mousedDot < stats.servers.length) - window.location = serverurl + stats.servers[mousedDot].ip; -} - -window.onload = function() { - drawGrid(); - drawDots(); - getXML(); -} - http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/bulkImport.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/bulkImport.ftl b/server/monitor/src/main/resources/templates/bulkImport.ftl index 649a1b1..958fa69 100644 --- a/server/monitor/src/main/resources/templates/bulkImport.ftl +++ b/server/monitor/src/main/resources/templates/bulkImport.ftl @@ -17,12 +17,12 @@ <div><h3>${title}</h3></div> <div class="center-block"> <table id="masterBulkImportStatus" class="table table-bordered table-striped table-condensed"> - + </table> </div> <div class="center-block"> <table id="bulkImportStatus" class="table table-bordered table-striped table-condensed"> - + </table> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/default.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/default.ftl b/server/monitor/src/main/resources/templates/default.ftl new file mode 100644 index 0000000..77a5ce8 --- /dev/null +++ b/server/monitor/src/main/resources/templates/default.ftl @@ -0,0 +1,71 @@ +<!-- + 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. +--> +<html> + <head> + <title>${title} - Accumulo ${version}</title> + <meta http-equiv="Content-Type" content="test/html" /> + <meta http-equiv="Content-Script-Type" content="text/javascript" /> + <meta http-equiv="Content-Style-Type" content="text/css" /> + <link rel="shortcut icon" type="image/jng" href="/resources/images/favicon.png" /> + <script src="/resources/js/global.js" type="text/javascript"></script> + <script src="/resources/js/functions.js" type="text/javascript"></script> + + <script src="https://code.jquery.com/jquery-2.2.4.js"></script> + <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> + + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + + <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> + <script language="javascript" type="text/javascript" src="/resources/js/flot/jquery.flot.js"></script> + <script language="javascript" type="text/javascript" src="/resources/js/flot/jquery.flot.time.js"></script> + <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" /> + <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> + + <link rel="stylesheet" type="text/css" href="/resources/css/screen.css" media="screen" /> + <script> + /** + * Sets up autorefresh on initial load + */ + $(document).ready(function() { + setupAutoRefresh(); + }); + </script> + <#if js??> + <script src="/resources/js/${js}"></script> + </#if> + <script src="/resources/js/navbar.js"></script> + </head> + + <body> + <#include "/templates/modals.ftl"> + <div id="content-wrapper"> + <div id="content"> + <div id="navbar" class="navbar navbar-inverse navbar-fixed-top"> + <#include "/templates/navbar.ftl"> + </div> + + <div id="main"> + <#include "/templates/${template}"> + + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/gc.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/gc.ftl b/server/monitor/src/main/resources/templates/gc.ftl index 94426c2..eb00261 100644 --- a/server/monitor/src/main/resources/templates/gc.ftl +++ b/server/monitor/src/main/resources/templates/gc.ftl @@ -13,11 +13,11 @@ 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. ---> +--> <div><h3>${title}</h3></div> <div id="gcBanner"></div> <div class="center-block"> <table id="gcActivity" class="table table-bordered table-striped table-condensed"> - + </table> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/header.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/header.ftl b/server/monitor/src/main/resources/templates/header.ftl deleted file mode 100644 index b69af52..0000000 --- a/server/monitor/src/main/resources/templates/header.ftl +++ /dev/null @@ -1,21 +0,0 @@ -<#-- - 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. ---> - <div id="headertitle"> - <ul class="nav nav-pills"> - <li><a href="/">${instance_name}</a></li> - </ul> - </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/index.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/index.ftl b/server/monitor/src/main/resources/templates/index.ftl deleted file mode 100644 index 773c4c2..0000000 --- a/server/monitor/src/main/resources/templates/index.ftl +++ /dev/null @@ -1,72 +0,0 @@ -<!-- - 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. ---> -<html> - <head> - <title>${title} - Accumulo ${version}</title> - <meta http-equiv="Content-Type" content="test/html" /> - <meta http-equiv="Content-Script-Type" content="text/javascript" /> - <meta http-equiv="Content-Style-Type" content="text/css" /> - <link rel="shortcut icon" type="image/jng" href="/resources/favicon.png" /> - <script src="/resources/global.js" type="text/javascript"></script> - <script src="/resources/functions.js" type="text/javascript"></script> - - <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> - <script src="https://code.jquery.com/jquery-1.12.4.js"></script> - - <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> - - <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> - <script language="javascript" type="text/javascript" src="/resources/flot/jquery.flot.js"></script> - <script language="javascript" type="text/javascript" src="/resources/flot/jquery.flot.time.js"></script> - <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" /> - <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> - - <link rel="stylesheet" type="text/css" href="/resources/screen.css" media="screen" /> - <script> - /** - * Sets up autorefresh on initial load - */ - $(document).ready(function() { - setupAutoRefresh(); - }); - </script> - <#if js??> - <script src="/resources/${js}"></script> - </#if> - <script src="/resources/sidebar.js"></script> - </head> - - <body> - <#include "/templates/modals.ftl"> - <div id="content-wrapper"> - <div id="content"> - <div id="sidebar" class="navbar navbar-inverse navbar-fixed-top"> - <!--<#include "/templates/header.ftl">--> - <#include "/templates/sidebar.ftl"> - </div> - - <div id="main"> - <#include "/templates/${template}"> - - </div> - </div> - </div> - </body> -</html> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/listType.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/listType.ftl b/server/monitor/src/main/resources/templates/listType.ftl index caae21c..6f7f400 100644 --- a/server/monitor/src/main/resources/templates/listType.ftl +++ b/server/monitor/src/main/resources/templates/listType.ftl @@ -23,7 +23,7 @@ refreshListType(); }); </script> - + <div><h3>${title}</h3></div> <div class="center-block"> <table id="trace" class="table table-bordered table-striped table-condensed"> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/log.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/log.ftl b/server/monitor/src/main/resources/templates/log.ftl index 9bebd24..2109934 100644 --- a/server/monitor/src/main/resources/templates/log.ftl +++ b/server/monitor/src/main/resources/templates/log.ftl @@ -13,10 +13,10 @@ 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. ---> +--> <div><h3>${title}</h3></div> <div class="center-block"> <table id="logTable" class="table table-bordered table-striped table-condensed"> - + </table> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/master.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/master.ftl b/server/monitor/src/main/resources/templates/master.ftl index 128b695..72c9cb0 100644 --- a/server/monitor/src/main/resources/templates/master.ftl +++ b/server/monitor/src/main/resources/templates/master.ftl @@ -18,12 +18,12 @@ <div id="masterBanner"></div> <div class="center-block"> <table id="masterStatus" class="table table-bordered table-striped table-condensed"> - + </table> <table id="recoveryList" class="table table-bordered table-striped table-condensed"> </table> </div> - <br /> - <script src="/resources/${tablesJs}"></script> - <#include "/templates/${tablesTemplate}"> \ No newline at end of file + <br> + <script src="/resources/js/${tablesJs}"></script> + <#include "/templates/${tablesTemplate}"> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/modals.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/modals.ftl b/server/monitor/src/main/resources/templates/modals.ftl index 49cd390..d2205c0 100644 --- a/server/monitor/src/main/resources/templates/modals.ftl +++ b/server/monitor/src/main/resources/templates/modals.ftl @@ -17,7 +17,6 @@ <!-- Modal --> <div id="aboutModal" data-target="#aboutModal" class="modal fade" role="dialog"> <div class="modal-dialog" role="document"> - <!-- Modal content --> <div class="modal-content"> <div class="modal-header"> @@ -36,4 +35,4 @@ </div> </div> </div> - </div> \ No newline at end of file + </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/navbar.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/navbar.ftl b/server/monitor/src/main/resources/templates/navbar.ftl new file mode 100644 index 0000000..6cd2beb --- /dev/null +++ b/server/monitor/src/main/resources/templates/navbar.ftl @@ -0,0 +1,85 @@ +<#-- + 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. +--> + <div class="container-fluid"> + <!-- toggle --> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-items" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" id="headertitle" href="/">${instance_name}</a> + </div> + <!-- Nav links --> + <div class="collapse navbar-collapse" id="nav-items"> + <ul class="nav navbar-nav navbar-right"> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><span id="statusNotification" class="icon-dot normal"></span> Servers <span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li><a href="/master"><span id="masterStatusNotification" class="icon-dot normal"></span> Master Server </a></li> + <li><a href="/tservers"><span id="serverStatusNotification" class="icon-dot normal"></span> Tablet Servers </a></li> + <li><a href="/gc"><span id="gcStatusNotification" class="icon-dot normal"></span> Garbage collector </a></li> + </ul> + </li> + <li><a href="/tables">Tables</a></li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> + Activity <span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li><a href="/scans">Active Scans</a></li> + <li><a href="/bulkImports">Bulk Imports</a></li> + <li><a href="/vis">Server Activity</a></li> + <li><a href="/replication">Replication</a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Debug <span id="errorsNotification" class="badge"></span><span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li><a href="/trace/summary?minutes=10">Recent Traces</a></li> + <li><a href="/log">Recent Logs <span id="recentLogsNotifications" class="badge"></span></a></li> + <li><a href="/problems">Table Problems <span id="tableProblemsNotifications" class="badge"></span></a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> + API <span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li><a href="/rest">XML</a></li> + <li><a href="/rest/tservers">JSON</a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> + <span class="glyphicon glyphicon-option-vertical"></span> + </a> + <ul class="dropdown-menu"> + <li><a class="auto-refresh" style="cursor:pointer">Auto-Refresh</a></li> + <li><a data-toggle="modal" href="#aboutModal">About</a></li> + </ul> + </li> + </ul> + </div> + </div> + <script> + // Obtain the current time + document.getElementById('currentDate').innerHTML = Date(); + </script> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/overview.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/overview.ftl b/server/monitor/src/main/resources/templates/overview.ftl index 0d7233c..8d95ba0 100644 --- a/server/monitor/src/main/resources/templates/overview.ftl +++ b/server/monitor/src/main/resources/templates/overview.ftl @@ -17,74 +17,74 @@ <div><h3>${title}</h3></div> <br> <div class="center-block"> - <table class="overview-table"> - <tr> - <td class="noborder" id="master"></td> - <td class="noborder" id="zookeeper"></td> - </tr> - </table> + <div class="container"> + <div class="row"> + <div class="col-md-6" id="master"></div> + <div class="col-md-6" id="zookeeper"></div> + </div> + </div> </div> <div class="center-block"> - <table class="overview-table"> - <tr> - <td> + <div class="container"> + <div class="row"> + <div class="col-md-6"> <br> <div class="plotHeading">Ingest (Entries/s)</div> <div id="ingest_entries" style="width:100%;height:200px;"></div> - </td> - <td> + </div> + <div class="col-md-6"> <br> <div class="plotHeading">Scan (Entries/s)</div> <div id="scan_entries" style="width:100%;height:200px;"></div> - </td> - </tr> - <tr> - <td> + </div> + </div> + <div class="row"> + <div class="col-md-6"> <br> <div class="plotHeading">Ingest (MB/s)</div> <div id="ingest_mb" style="width:100%;height:200px;"></div> - </td> - <td> + </div> + <div class="col-md-6"> <br> <div class="plotHeading">Scan (MB/s)</div> <div id="scan_mb" style="width:100%;height:200px;"></div> - </td> - </tr> - <tr> - <td> + </div> + </div> + <div class="row"> + <div class="col-md-6"> <br> <div class="plotHeading">Load Average</div> <div id="load_avg" style="width:100%;height:200px;"></div> - </td> - <td> + </div> + <div class="col-md-6"> <br> <div class="plotHeading">Seeks</div> <div id="seeks" style="width:100%;height:200px;"></div> - </td> - </tr> - <tr> - <td> + </div> + </div> + <div class="row"> + <div class="col-md-6"> <br> <div class="plotHeading">Minor Compactions</div> <div id="minor" style="width:100%;height:200px;"></div> - </td> - <td> + </div> + <div class="col-md-6"> <br> <div class="plotHeading">Major Compactions</div> <div id="major" style="width:100%;height:200px;"></div> - </td> - </tr> - <tr> - <td> + </div> + </div> + <div class="row"> + <div class="col-md-6"> <br> <div class="plotHeading">Index Cache Hit Rate</div> <div id="index_cache" style="width:100%;height:200px;"></div> - </td> - <td> + </div> + <div class="col-md-6"> <br> <div class="plotHeading">Data Cache Hit Rate</div> <div id="data_cache" style="width:100%;height:200px;"></div> - </td> - </tr> - </table> + </div> + </div> + </div> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/problems.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/problems.ftl b/server/monitor/src/main/resources/templates/problems.ftl index bdbb4f6..82b1a19 100644 --- a/server/monitor/src/main/resources/templates/problems.ftl +++ b/server/monitor/src/main/resources/templates/problems.ftl @@ -28,9 +28,9 @@ <div><h3>${title}</h3></div> <div class="center-block"> <table id="problemSummary" class="table table-bordered table-striped table-condensed"> - + </table> <table id="problemDetails" class="table table-bordered table-striped table-condensed"> - + </table> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/replication.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/replication.ftl b/server/monitor/src/main/resources/templates/replication.ftl index 3c2dff9..13856fa 100644 --- a/server/monitor/src/main/resources/templates/replication.ftl +++ b/server/monitor/src/main/resources/templates/replication.ftl @@ -13,10 +13,10 @@ 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. ---> +--> <div><h3>${title}</h3></div> <div class="center-block"> <table id="replicationStats" class="table table-bordered table-striped table-condensed"> - + </table> </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/server.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/server.ftl b/server/monitor/src/main/resources/templates/server.ftl index 53d6b11..3066dd1 100644 --- a/server/monitor/src/main/resources/templates/server.ftl +++ b/server/monitor/src/main/resources/templates/server.ftl @@ -29,21 +29,21 @@ <div><h3>${title}</h3></div> <div class="center-block"> <table id="tServerDetail" class="table table-bordered table-striped table-condensed"> - + </table> </div> <div class="center-block"> <table id="opHistoryDetails" class="table table-bordered table-striped table-condensed"> - + </table> </div> <div class="center-block"> <table id="currentTabletOps" class="table table-bordered table-striped table-condensed"> - + </table> </div> <div class="center-block"> <table id="perTabletResults" class="table table-bordered table-striped table-condensed"> - + </table> - </div> \ No newline at end of file + </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/show.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/show.ftl b/server/monitor/src/main/resources/templates/show.ftl index e856729..95912b3 100644 --- a/server/monitor/src/main/resources/templates/show.ftl +++ b/server/monitor/src/main/resources/templates/show.ftl @@ -25,10 +25,12 @@ */ $(document).ready(function() { createHeader('${id}'); - refreshTraceShow(); + + // Create tooltip for table column information + $(document).tooltip(); }); - + /** * Toggles row * @@ -42,7 +44,7 @@ elt.style.display='none'; } } - + /** * Selects where to display the row */ @@ -60,6 +62,6 @@ <div><h3>${title}</h3></div> <div class="center-block"> <table id="trace" class="table table-bordered table-striped table-condensed"> - + </table> - </div> \ No newline at end of file + </div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/sidebar.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/sidebar.ftl b/server/monitor/src/main/resources/templates/sidebar.ftl deleted file mode 100644 index 6cd2beb..0000000 --- a/server/monitor/src/main/resources/templates/sidebar.ftl +++ /dev/null @@ -1,85 +0,0 @@ -<#-- - 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. ---> - <div class="container-fluid"> - <!-- toggle --> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-items" aria-expanded="false"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand" id="headertitle" href="/">${instance_name}</a> - </div> - <!-- Nav links --> - <div class="collapse navbar-collapse" id="nav-items"> - <ul class="nav navbar-nav navbar-right"> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><span id="statusNotification" class="icon-dot normal"></span> Servers <span class="caret"></span> - </a> - <ul class="dropdown-menu"> - <li><a href="/master"><span id="masterStatusNotification" class="icon-dot normal"></span> Master Server </a></li> - <li><a href="/tservers"><span id="serverStatusNotification" class="icon-dot normal"></span> Tablet Servers </a></li> - <li><a href="/gc"><span id="gcStatusNotification" class="icon-dot normal"></span> Garbage collector </a></li> - </ul> - </li> - <li><a href="/tables">Tables</a></li> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> - Activity <span class="caret"></span> - </a> - <ul class="dropdown-menu"> - <li><a href="/scans">Active Scans</a></li> - <li><a href="/bulkImports">Bulk Imports</a></li> - <li><a href="/vis">Server Activity</a></li> - <li><a href="/replication">Replication</a></li> - </ul> - </li> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Debug <span id="errorsNotification" class="badge"></span><span class="caret"></span> - </a> - <ul class="dropdown-menu"> - <li><a href="/trace/summary?minutes=10">Recent Traces</a></li> - <li><a href="/log">Recent Logs <span id="recentLogsNotifications" class="badge"></span></a></li> - <li><a href="/problems">Table Problems <span id="tableProblemsNotifications" class="badge"></span></a></li> - </ul> - </li> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> - API <span class="caret"></span> - </a> - <ul class="dropdown-menu"> - <li><a href="/rest">XML</a></li> - <li><a href="/rest/tservers">JSON</a></li> - </ul> - </li> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> - <span class="glyphicon glyphicon-option-vertical"></span> - </a> - <ul class="dropdown-menu"> - <li><a class="auto-refresh" style="cursor:pointer">Auto-Refresh</a></li> - <li><a data-toggle="modal" href="#aboutModal">About</a></li> - </ul> - </li> - </ul> - </div> - </div> - <script> - // Obtain the current time - document.getElementById('currentDate').innerHTML = Date(); - </script> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/summary.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/summary.ftl b/server/monitor/src/main/resources/templates/summary.ftl index 02b69d0..583753e 100644 --- a/server/monitor/src/main/resources/templates/summary.ftl +++ b/server/monitor/src/main/resources/templates/summary.ftl @@ -21,13 +21,15 @@ $(document).ready(function() { createHeader('${minutes}'); refreshSummary(); + + // Create tooltip for table column information + $(document).tooltip(); }); </script> - + <div><h3>${title}</h3></div> <div class="center-block"> <table id="traceSummary" class="table table-bordered table-striped table-condensed"> - + </table> </div> - http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/table.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/table.ftl b/server/monitor/src/main/resources/templates/table.ftl index 0f7c701..52a22b7 100644 --- a/server/monitor/src/main/resources/templates/table.ftl +++ b/server/monitor/src/main/resources/templates/table.ftl @@ -21,6 +21,9 @@ $(document).ready(function() { createHeader('${table}', '${tableID}'); refreshTable(); + + // Create tooltip for table column information + $(document).tooltip(); }); </script> <div><h3>${title}</h3></div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/tables.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/tables.ftl b/server/monitor/src/main/resources/templates/tables.ftl index fcdc221..a621b65 100644 --- a/server/monitor/src/main/resources/templates/tables.ftl +++ b/server/monitor/src/main/resources/templates/tables.ftl @@ -24,6 +24,9 @@ <#if tablesJs??> toggleMaster(true); </#if> + + // Create tooltip for table column information + $(document).tooltip(); }); </script> <div><h3>${tablesTitle}</h3></div> http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/tservers.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/tservers.ftl b/server/monitor/src/main/resources/templates/tservers.ftl index f38fc50..115a20c 100644 --- a/server/monitor/src/main/resources/templates/tservers.ftl +++ b/server/monitor/src/main/resources/templates/tservers.ftl @@ -17,13 +17,12 @@ <div><h3>${title}</h3></div> <div class="center-block"> <table id="badtservers" class="table table-bordered table-striped table-condensed"> - + </table> <table id="deadtservers" class="table table-bordered table-striped table-condensed"> - + </table> <table id="tservers" class="table table-bordered table-striped table-condensed"> - + </table> </div> - http://git-wip-us.apache.org/repos/asf/accumulo/blob/680b3a21/server/monitor/src/main/resources/templates/vis.ftl ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/resources/templates/vis.ftl b/server/monitor/src/main/resources/templates/vis.ftl index 84f8704..3b504c7 100644 --- a/server/monitor/src/main/resources/templates/vis.ftl +++ b/server/monitor/src/main/resources/templates/vis.ftl @@ -35,7 +35,7 @@ </div> </div> </div> - + <script type="text/javascript"> /** * Creates initial visualization table, passes the shape, size, motion, and color from the template @@ -48,11 +48,11 @@ $.ajaxSetup({ async: true }); - + setStats(); setOptions('${shape}', '${size}', '${motion}', '${color}'); setState(); - + drawGrid(); getXML(); refresh(); @@ -62,11 +62,11 @@ <script type="text/javascript"> // Populates variables to be used in the visualization var numCores = 8; - var jsonurl = '/rest/json'; + var jsonurl = '/rest/tservers'; var visurl = '/vis'; var serverurl = '/tservers?s='; var numNormalStats = 8; </script> - - <script src="/resources/vis.js"></script> + + <script src="/resources/js/vis.js"></script>
