SOLR-11558: It would be nice if the Graph section of the Cloud tab in the Admin UI could give some more information about the replicas of a collection

This commit is contained in:
Erick Erickson 2019-05-15 11:35:18 -07:00
parent 7ef5d5fe5f
commit 9ff5eb30af
2 changed files with 49 additions and 15 deletions

View File

@ -85,6 +85,9 @@ New Features
* SOLR-13440: Support saving/restoring autoscaling state for repeatable simulations. (ab)
* SOLR-11558: It would be nice if the Graph section of the Cloud tab in the Admin UI could give some more
information about the replicas of a collection (Erick Erickson)
Other Changes
----------------------

View File

@ -731,7 +731,9 @@ var graphSubController = function ($scope, Zookeeper) {
name: shard_status == "shard-inactive" ? s + ' (inactive)' : s,
data: {
type: 'shard',
state: shard_status
state: shard_status,
range: state[c].shards[s].range
},
children: nodes
};
@ -741,13 +743,20 @@ var graphSubController = function ($scope, Zookeeper) {
var collection = {
name: c,
data: {
type: 'collection'
type: 'collection',
pullReplicas: state[c].pullReplicas,
replicationFactor: state[c].replicationFactor,
router: state[c].router.name,
maxShardsPerNode: state[c].maxShardsPerNode,
autoAddReplicas: state[c].autoAddReplicas,
nrtReplicas: state[c].nrtReplicas,
tlogReplicas: state[c].tlogReplicas,
numShards: shards.length
},
children: shards
};
graph_data.children.push(collection);
}
$scope.helperData.protocol = $.unique($scope.helperData.protocol);
$scope.helperData.host = $.unique($scope.helperData.host);
$scope.helperData.hostname = $.unique($scope.helperData.hostname);
@ -844,22 +853,45 @@ solrAdminApp.directive('graph', function(Constants) {
};
var helper_tooltip_text = function (d) {
if (!d.data || !d.data.uri) {
return tooltip;
if (!d.data) {
return tooltip;
}
var tooltip;
if (! d.data.type) {
return tooltip;
}
var tooltip = d.data.uri.core_node + " {<br/>";
if (0 !== scope.helperData.core.length) {
tooltip += "core: [" + d.data.uri.core + "],<br/>";
if (d.data.type == 'collection') {
tooltip = d.name + " {<br/> ";
tooltip += "numShards: [" + d.data.numShards + "],<br/>";
tooltip += "maxShardsPerNode: [" + d.data.maxShardsPerNode + "],<br/>";
tooltip += "router: [" + d.data.router + "],<br/>";
tooltip += "autoAddReplicas: [" + d.data.autoAddReplicas + "],<br/>";
tooltip += "replicationFactor: [" + d.data.replicationFactor + "],<br/>";
tooltip += "nrtReplicas: [" + d.data.nrtReplicas + "],<br/>";
tooltip += "pullReplicas: [" + d.data.pullReplicas + "],<br/>";
tooltip += "tlogReplicas: [" + d.data.tlogReplicas + "],<br/>";
tooltip += "}";
} else if (d.data.type == 'shard') {
tooltip = d.name + " {<br/> ";
tooltip += "range: [" + d.data.range + "],<br/>";
tooltip += "state: [" + d.data.state + "],<br/>";
tooltip += "}";
} else if (d.data.type == 'node') {
tooltip = d.data.uri.core_node + " {<br/>";
if (0 !== scope.helperData.core.length) {
tooltip += "core: [" + d.data.uri.core + "],<br/>";
}
if (0 !== scope.helperData.node_name.length) {
tooltip += "node_name: [" + d.data.uri.node_name + "],<br/>";
}
tooltip += "}";
}
if (0 !== scope.helperData.node_name.length) {
tooltip += "node_name: [" + d.data.uri.node_name + "],<br/>";
}
tooltip += "}";
return tooltip;
};
@ -869,7 +901,6 @@ solrAdminApp.directive('graph', function(Constants) {
}
var name = d.data.uri.hostname;
if (1 !== scope.helperData.protocol.length) {
name = d.data.uri.protocol + '//' + name;
}