Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 0 additions & 116 deletions solr/webapp/web/js/angular/controllers/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
23 changes: 1 addition & 22 deletions solr/webapp/web/partials/cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@
<th>Node</th>
<th>CPU</th>
<th>Heap</th>
<th>Disk usage</th>
<th>Requests</th>
<th>Collections</th>
<th>Replicas</th>
</tr>
Expand All @@ -164,7 +162,6 @@
Uptime: {{h.uptime}}<br/>
<span title="Used: {{h.memUsed}} - includes OS file-cache, and it is normal for it to approach 100%">Memory: {{h.memTotal}}</span><br/>
File descriptors: {{h.openFileDescriptorCount}}/{{h.maxFileDescriptorCount}}<br/>
Disk: <span class="{{h.diskUsedPctStyle}}" title="Nodes may use other disks too">{{h.diskTotal}} used: {{h.diskUsedPct}}%</span><br/>
Load: {{h.loadAvg}}
</div>
<div class="node-spec" ng-click="toggleHostDetails(h.host)">
Expand Down Expand Up @@ -200,21 +197,6 @@
Used: {{n.heapUsed}}
</div>
</td>
<td class="scroll-height-250" ng-class="{'dead-node': n.dead}">
<div>
<div class="node-disk" title="Available disk: {{n.diskTotal}} free: {{n.diskFree}} used by this node: {{n.size}}" ng-show="!n.dead">
{{n.size}}
</div>
<div class="node-spec" ng-show="showDetails[key] && !n.dead">
Total #docs: {{n.numDocs}}<br/>
Avg size/doc: {{n.sizePerDoc}}
</div>
<div id="chart{{n.id}}" ng-show="showDetails[key] && !n.dead"></div>
</div>
</td>
<td ng-class="{'dead-node': n.dead}"><div class="node-requests" title="1minRate: {{n.req1minRate}} 5minRate: {{n.req5minRate}} 15minRate: {{n.req15minRate}} p75: {{n.reqp75_ms}} p99: {{n.reqp99_ms}}" ng-show="!n.dead">
RPM: {{n.req15minRate}}<br/>p95: {{n.reqp95_ms}}ms</div>
</td>
<td ng-class="{'dead-node': n.dead}">
<div ng-show="!n.collections">(none)</div>
<div ng-repeat="c in n.collections | limitTo:showDetails[key]?999:2 track by $index">
Expand All @@ -227,12 +209,9 @@
<td class="scroll-height-250" ng-class="{'dead-node': n.dead}">
<div ng-show="!n.cores">(none)</div>
<div ng-repeat="core in n.cores | limitTo:showDetails[key]?999:2 track by $index">
<div ng-show="!n.dead"><a class="{{core.leader ? 'leader' : 'replica'}}" href="{{core.base_url + '/#/' + core.core + '/core-overview'}}">{{ core.label }}</a> ({{core.numDocsHuman}} docs)</div>
<div ng-show="!n.dead"><a class="{{core.leader ? 'leader' : 'replica'}}" href="{{core.base_url + '/#/' + core.core + '/core-overview'}}">{{ core.label }}</a></div>
<div ng-show="n.dead">{{ core.label }}</div>
<ul class="core-details" ng-show="showDetails[key] && !n.dead" >
<li>deleted: {{core.deletedDocsHuman}}</li>
<li>warmupTime: {{core.warmupTime}}</li>
<li ng-show="core.numDocs > 0">avg size/doc: {{core.avgSizePerDoc}}</li>
</ul>
</div>
<div class="more" ng-show="n.cores.length > 2 && !showDetails[key] && !n.dead">
Expand Down
Loading