Updated Branches: refs/heads/trunk f661509a4 -> 2e9a93fae
Display more detail on CPU / Cores on Host pages. (xiwang via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2e9a93fa Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2e9a93fa Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2e9a93fa Branch: refs/heads/trunk Commit: 2e9a93faedab008de110a4f69d54f1478de21a9b Parents: f661509 Author: Yusaku Sako <[email protected]> Authored: Mon Jan 6 17:15:03 2014 -0800 Committer: Yusaku Sako <[email protected]> Committed: Mon Jan 6 17:15:03 2014 -0800 ---------------------------------------------------------------------- ambari-web/app/controllers/global/cluster_controller.js | 2 +- ambari-web/app/mappers/hosts_mapper.js | 3 +++ ambari-web/app/messages.js | 1 + ambari-web/app/models/host.js | 5 +++++ ambari-web/app/templates/main/host.hbs | 2 +- ambari-web/app/templates/main/host/summary.hbs | 2 +- ambari-web/app/views/main/host.js | 2 +- 7 files changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/controllers/global/cluster_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index ed7789b..caca14b 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -326,7 +326,7 @@ App.ClusterController = Em.Controller.extend({ return; } var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters'); - var hostsRealUrl = '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count,Hosts/total_mem,' + + var hostsRealUrl = '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/total_mem,' + 'Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components,Hosts/disk_info,' + 'metrics/disk,metrics/load/load_one,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free'+ '&minimal_response=true'; http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/mappers/hosts_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index 828e685..702a5c2 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/ambari-web/app/mappers/hosts_mapper.js @@ -39,6 +39,7 @@ App.hostsMapper = App.QuickDataMapper.create({ item: 'id' }, cpu: 'Hosts.cpu_count', + cpu_physical: 'Hosts.ph_cpu_count', memory: 'Hosts.total_mem', disk_info: 'Hosts.disk_info', disk_total: 'metrics.disk.disk_total', @@ -109,6 +110,7 @@ App.hostsMapper = App.QuickDataMapper.create({ public_host_name: host.public_host_name, memory: host.memory, cpu: host.cpu, + cpu_physical: host.cpu_physical, host_components: host.host_components }; }); @@ -125,6 +127,7 @@ App.hostsMapper = App.QuickDataMapper.create({ host.public_host_name = cacheHost.public_host_name; host.memory = cacheHost.memory; host.cpu = cacheHost.cpu; + host.cpu_physical = cacheHost.cpu_physical; host.host_components = cacheHost.host_components; } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 9e96578..aef361b 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -90,6 +90,7 @@ Em.I18n.translations = { 'common.value':'Value', 'common.ipAddress':'IP Address', 'common.cpu':'CPU', + 'common.cores': 'Cores (CPU)', 'common.ram':'RAM', 'common.disk':'Disk', 'common.diskUsage':'Disk Usage', http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/models/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js index c215b73..2985c35 100644 --- a/ambari-web/app/models/host.js +++ b/ambari-web/app/models/host.js @@ -26,6 +26,7 @@ App.Host = DS.Model.extend({ cluster: DS.belongsTo('App.Cluster'), hostComponents: DS.hasMany('App.HostComponent'), cpu: DS.attr('string'), + cpuPhysical: DS.attr('string'), memory: DS.attr('string'), diskTotal: DS.attr('number'), diskFree: DS.attr('number'), @@ -107,6 +108,10 @@ App.Host = DS.Model.extend({ return this.get('diskInfo.length'); }.property('diskInfo.length'), + coresFormatted: function() { + return this.get('cpu') + ' (' + this.get('cpuPhysical') + ')'; + }.property('cpu', 'cpuPhysical'), + /** * API return diskTotal and diskFree. Need to save their different * @returns {Number} http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/templates/main/host.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/host.hbs b/ambari-web/app/templates/main/host.hbs index 8962ec7..7acff77 100644 --- a/ambari-web/app/templates/main/host.hbs +++ b/ambari-web/app/templates/main/host.hbs @@ -118,7 +118,7 @@ {{/if}} </td> <td>{{host.ip}}</td> - <td>{{host.cpu}}</td> + <td>{{host.coresFormatted}}</td> <td>{{host.memoryFormatted}}</td> <td> http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/templates/main/host/summary.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/host/summary.hbs b/ambari-web/app/templates/main/host/summary.hbs index a64d664..1216f9b 100644 --- a/ambari-web/app/templates/main/host/summary.hbs +++ b/ambari-web/app/templates/main/host/summary.hbs @@ -207,7 +207,7 @@ <dt>{{t hosts.host.summary.hostname}}:</dt><dd> {{view.content.publicHostName}}</dd> <dt>{{t common.ipAddress}}:</dt><dd> {{view.content.ip}}</dd> <dt>{{t common.os}}:</dt><dd> {{view.content.osType}} ({{view.content.osArch}})</dd> - <dt>{{t common.cpu}}:</dt><dd> {{view.content.cpu}}</dd> + <dt>{{t common.cores}}:</dt><dd> {{view.content.coresFormatted}}</dd> <dt>{{t common.disk}}:</dt><dd> {{view.content.diskInfoBar}}</dd> <dt>{{t common.memory}}:</dt><dd> {{view.content.memoryFormatted}}</dd> <dt>{{t common.loadAvg}}:</dt><dd> {{view.content.loadAvg}}</dd> http://git-wip-us.apache.org/repos/asf/ambari/blob/2e9a93fa/ambari-web/app/views/main/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js index 110d9c2..43e96e6 100644 --- a/ambari-web/app/views/main/host.js +++ b/ambari-web/app/views/main/host.js @@ -62,7 +62,7 @@ App.MainHostView = App.TableView.extend({ cpuSort: sort.fieldView.extend({ column: 3, name:'cpu', - displayName: Em.I18n.t('common.cpu'), + displayName: Em.I18n.t('common.cores'), type: 'number' }), memorySort: sort.fieldView.extend({
