nwangtw commented on a change in pull request #3375: Add instance resource
usage in container
URL: https://github.com/apache/incubator-heron/pull/3375#discussion_r338323136
##########
File path: heron/tools/ui/resources/static/js/physical-plan.js
##########
@@ -63,16 +63,23 @@
container.children = _.sortBy(container.children, 'name');
// Parse index
container.index = parseInt(container.id.split('-')[1]);
- // Search for resource config in packing plan
+ // Search for container resource config in packing plan
container.required_resources = {
- 'cpu': 0,
- 'disk': 0,
- 'ram': 0
+ 'cpu': 'unknown',
+ 'disk': 'unknown',
+ 'ram': 'unknown'
};
for (var i in containerPlan) {
var packing = containerPlan[i];
if (packing.id === container.index) {
container.required_resources = packing.required_resources;
+ // Get instance resources
+ var instance_resources = {};
+ for (var j in packing.instances) {
+ var inst = packing.instances[j];
+ instance_resources[inst.component_name + '_' + inst.task_id] =
inst.instance_resources;
+ }
Review comment:
Maybe next time. :p
Map function is not available for dict. For loop might be more
straightforward here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services