diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.js index b766c9a6e6b..882f66b2b23 100644 --- a/solr/webapp/web/js/angular/controllers/cloud.js +++ b/solr/webapp/web/js/angular/controllers/cloud.js @@ -390,122 +390,6 @@ var nodesSubController = function($scope, Collections, System, Metrics) { } }); - /* - Fetch metrics for all selected nodes. Only pull the metrics that we'll show to save bandwidth - Pick the data we want to display and add it to the node-centric data structure - */ - Metrics.get({ - "nodes": nodesParam, - "prefix": "CONTAINER.fs,org.eclipse.jetty.server.handler.DefaultHandler.get-requests,INDEX.sizeInBytes,SEARCHER.searcher.numDocs,SEARCHER.searcher.deletedDocs,SEARCHER.searcher.warmupTime" - }, - function (metricsResponse) { - for (var node in metricsResponse) { - if (node in nodes) { - var m = metricsResponse[node]; - nodes[node]['metrics'] = m; - var diskTotal = m.metrics['solr.node']['CONTAINER.fs.totalSpace']; - var diskFree = m.metrics['solr.node']['CONTAINER.fs.usableSpace']; - var diskPercentage = Math.floor((diskTotal - diskFree) / diskTotal * 100); - nodes[node]['diskUsedPct'] = diskPercentage; - nodes[node]['diskUsedPctStyle'] = styleForPct(diskPercentage); - nodes[node]['diskTotal'] = bytesToSize(diskTotal); - nodes[node]['diskFree'] = bytesToSize(diskFree); - - var r = m.metrics['solr.jetty']['org.eclipse.jetty.server.handler.DefaultHandler.get-requests']; - nodes[node]['req'] = r.count; - nodes[node]['req1minRate'] = Math.floor(r['1minRate'] * 100) / 100; - nodes[node]['req5minRate'] = Math.floor(r['5minRate'] * 100) / 100; - nodes[node]['req15minRate'] = Math.floor(r['15minRate'] * 100) / 100; - nodes[node]['reqp75_ms'] = Math.floor(r['p75_ms']); - nodes[node]['reqp95_ms'] = Math.floor(r['p95_ms']); - nodes[node]['reqp99_ms'] = Math.floor(r['p99_ms']); - - // These are the cores we _expect_ to find on this node according to the CLUSTERSTATUS - var cores = nodes[node]['cores']; - var indexSizeTotal = 0; - var indexSizeMax = 0; - var docsTotal = 0; - var graphData = []; - for (let coreId in cores) { - var core = cores[coreId]; - if (core['shard_state'] !== 'active' || core['state'] !== 'active') { - // If core state is not active, display the real state, or if shard is inactive, display that - var labelState = (core['state'] !== 'active') ? core['state'] : core['shard_state']; - core['label'] += "_(" + labelState + ")"; - } - var coreMetricName = "solr.core." + core['collection'] + "." + core['shard'] + "." + core['replica']; - var coreMetric = m.metrics[coreMetricName]; - // we may not actually get metrics back for every expected core (the core may be down) - if (coreMetric) { - var size = coreMetric['INDEX.sizeInBytes']; - size = (typeof size !== 'undefined') ? size : 0; - core['sizeInBytes'] = size; - core['size'] = bytesToSize(size); - indexSizeTotal = indexSizeTotal + size; - indexSizeMax = size > indexSizeMax ? size : indexSizeMax; - var numDocs = coreMetric['SEARCHER.searcher.numDocs']; - numDocs = (typeof numDocs !== 'undefined') ? numDocs : 0; - core['numDocs'] = numDocs; - core['numDocsHuman'] = numDocsHuman(numDocs); - core['avgSizePerDoc'] = bytesToSize(numDocs === 0 ? 0 : size / numDocs); - var deletedDocs = coreMetric['SEARCHER.searcher.deletedDocs']; - deletedDocs = (typeof deletedDocs !== 'undefined') ? deletedDocs : 0; - core['deletedDocs'] = deletedDocs; - core['deletedDocsHuman'] = numDocsHuman(deletedDocs); - var warmupTime = coreMetric['SEARCHER.searcher.warmupTime']; - warmupTime = (typeof warmupTime !== 'undefined') ? warmupTime : 0; - core['warmupTime'] = warmupTime; - docsTotal += core['numDocs']; - } - } - for (let coreId in cores) { - var core = cores[coreId]; - var graphObj = {}; - graphObj['label'] = core['label']; - graphObj['size'] = core['sizeInBytes']; - graphObj['sizeHuman'] = core['size']; - graphObj['pct'] = (core['sizeInBytes'] / indexSizeMax) * 100; - graphData.push(graphObj); - } - if (cores) { - cores.sort(function (a, b) { - return b.sizeInBytes - a.sizeInBytes - }); - } - graphData.sort(function (a, b) { - return b.size - a.size - }); - nodes[node]['graphData'] = graphData; - nodes[node]['numDocs'] = numDocsHuman(docsTotal); - nodes[node]['sizeInBytes'] = indexSizeTotal; - nodes[node]['size'] = bytesToSize(indexSizeTotal); - nodes[node]['sizePerDoc'] = docsTotal === 0 ? '0b' : bytesToSize(indexSizeTotal / docsTotal); - - // Build the d3 powered bar chart - $('#chart' + nodes[node]['id']).empty(); - var chart = d3.select('#chart' + nodes[node]['id']).append('div').attr('class', 'chart'); - - // Add one div per bar which will group together both labels and bars - var g = chart.selectAll('div') - .data(nodes[node]['graphData']).enter() - .append('div'); - - // Add the bars - var bars = g.append("div") - .attr("class", "rect") - .text(function (d) { - return d.label + ':\u00A0\u00A0' + d.sizeHuman; - }); - - // Execute the transition to show the bars - bars.transition() - .ease('elastic') - .style('width', function (d) { - return d.pct + '%'; - }); - } - } - }); $scope.nodes = nodes; $scope.hosts = hosts; $scope.live_nodes = live_nodes; diff --git a/solr/webapp/web/partials/cloud.html b/solr/webapp/web/partials/cloud.html index 01d63499ee3..ed619e11813 100644 --- a/solr/webapp/web/partials/cloud.html +++ b/solr/webapp/web/partials/cloud.html @@ -143,8 +143,6 @@