http://git-wip-us.apache.org/repos/asf/hadoop/blob/aab43959/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs deleted file mode 100644 index 1e8549b..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs +++ /dev/null @@ -1,125 +0,0 @@ -{{!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---}} - -{{breadcrumb-bar breadcrumbs=breadcrumbs}} - -<div class="col-md-12 container-fluid"> - <div class="row"> - - {{node-menu-panel path="yarn-node" nodeId=model.rmNode.id nodeAddr=model.node.id}} - - <div class="col-md-10 container-fluid"> - - <div class="row"> - <div class="col-md-12 container-fluid"> - <div class="panel panel-default"> - <div class="panel-heading">Node Information: {{model.rmNode.id}}</div> - <table class="table"> - <tbody> - <tr> - <td>Total Vmem allocated for Containers</td> - <td>{{divide num=model.node.totalVmemAllocatedContainersMB den=1024}} GB</td> - </tr> - <tr> - <td>Vmem enforcement enabled</td> - <td>{{model.node.vmemCheckEnabled}}</td> - </tr> - <tr> - <td>Total Pmem allocated for Containers</td> - <td>{{divide num=model.node.totalPmemAllocatedContainersMB den=1024}} GB</td> - </tr> - <tr> - <td>Pmem enforcement enabled</td> - <td>{{model.node.pmemCheckEnabled}}</td> - </tr> - <tr> - <td>Total VCores allocated for Containers</td> - <td>{{model.node.totalVCoresAllocatedContainers}}</td> - </tr> - <tr> - <td>Node Healthy Status</td> - <td>{{model.node.nodeHealthy}}</td> - </tr> - <tr> - <td>Last Node Health Report Time</td> - <td>{{model.node.lastNodeUpdateTime}}</td> - </tr> - <tr> - <td>Node Health Report</td> - <td>{{model.node.healthReport}}</td> - </tr> - {{#if model.node.nmStartupTime}} - <tr> - <td>Node Manager Start Time</td> - <td>{{model.node.nmStartupTime}}</td> - </tr> - {{/if}} - <tr> - <td>Node Manager Version</td> - <td>{{model.node.nodeManagerBuildVersion}}</td> - </tr> - <tr> - <td>Hadoop Version</td> - <td>{{model.node.hadoopBuildVersion}}</td> - </tr> - </tbody> - </table> - </div> - </div> - </div> - - <div class="row"> - <div class="col-lg-6 container-fluid"> - <div class="panel panel-default"> - <div class="panel-heading"> - Resource - Memory - </div> - <div class="container-fluid" id="mem-donut-chart"> - {{donut-chart data=model.rmNode.getMemoryDataForDonutChart - showLabels=true - parentId="mem-donut-chart" - ratio=0.6 - type="memory" - colorTargets="good" - colorTargetReverse=true - maxHeight=350}} - </div> - </div> - </div> - - <div class="col-lg-6 container-fluid"> - <div class="panel panel-default"> - <div class="panel-heading"> - Resource - VCores - </div> - <div class="container-fluid" id="vcore-donut-chart"> - {{donut-chart data=model.rmNode.getVCoreDataForDonutChart - showLabels=true - parentId="vcore-donut-chart" - ratio=0.6 - colorTargets="good" - colorTargetReverse=true - maxHeight=350}} - </div> - </div> - </div> - </div> - </div> - </div> -</div> -{{outlet}}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/aab43959/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs new file mode 100644 index 0000000..ad411c0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs @@ -0,0 +1,154 @@ +{{!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--}} + +{{breadcrumb-bar breadcrumbs=breadcrumbs}} + +<div class="col-md-12 container-fluid"> + <div class="row"> + + {{node-menu-panel path="yarn-node" nodeId=model.rmNode.id + nodeAddr=model.node.id nmGpuInfo=model.nmGpuInfo}} + + <div class="col-md-10 container-fluid"> + + <div class="row"> + <div class="col-md-12 container-fluid"> + <div class="panel panel-default"> + <div class="panel-heading">Node + Information: {{model.rmNode.id}}</div> + <table class="table"> + <tbody> + <tr> + <td>Total Vmem allocated for Containers</td> + <td>{{divide num=model.node.totalVmemAllocatedContainersMB + den=1024}} GB + </td> + </tr> + <tr> + <td>Vmem enforcement enabled</td> + <td>{{model.node.vmemCheckEnabled}}</td> + </tr> + <tr> + <td>Total Pmem allocated for Containers</td> + <td>{{divide num=model.node.totalPmemAllocatedContainersMB + den=1024}} GB + </td> + </tr> + <tr> + <td>Pmem enforcement enabled</td> + <td>{{model.node.pmemCheckEnabled}}</td> + </tr> + <tr> + <td>Total VCores allocated for Containers</td> + <td>{{model.node.totalVCoresAllocatedContainers}}</td> + </tr> + <tr> + <td>Node Healthy Status</td> + <td>{{model.node.nodeHealthy}}</td> + </tr> + <tr> + <td>Last Node Health Report Time</td> + <td>{{model.node.lastNodeUpdateTime}}</td> + </tr> + <tr> + <td>Node Health Report</td> + <td>{{model.node.healthReport}}</td> + </tr> + {{#if model.node.nmStartupTime}} + <tr> + <td>Node Manager Start Time</td> + <td>{{model.node.nmStartupTime}}</td> + </tr> + {{/if}} + <tr> + <td>Node Manager Version</td> + <td>{{model.node.nodeManagerBuildVersion}}</td> + </tr> + <tr> + <td>Hadoop Version</td> + <td>{{model.node.hadoopBuildVersion}}</td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + <div class="row"> + <div class="col-lg-6 container-fluid"> + <div class="panel panel-default"> + <div class="panel-heading"> + Resource - Memory + </div> + <div class="container-fluid" id="mem-donut-chart"> + {{donut-chart data=model.rmNode.getMemoryDataForDonutChart + showLabels=true + parentId="mem-donut-chart" + ratio=0.6 + type="memory" + colorTargets="good" + colorTargetReverse=true + maxHeight=350}} + </div> + </div> + </div> + + <div class="col-lg-6 container-fluid"> + <div class="panel panel-default"> + <div class="panel-heading"> + Resource - VCores + </div> + <div class="container-fluid" id="vcore-donut-chart"> + {{donut-chart data=model.rmNode.getVCoreDataForDonutChart + showLabels=true + parentId="vcore-donut-chart" + ratio=0.6 + colorTargets="good" + colorTargetReverse=true + maxHeight=350}} + </div> + </div> + </div> + </div> + + {{#if model.nmGpuInfo}} + <div class="row"> + <div class="col-lg-6 container-fluid"> + <div class="panel panel-default"> + <div class="panel-heading"> + <li> + Resources - yarn.io/gpu + </li> + </div> + <div class="container-fluid" id="gpu-donut-chart"> + {{donut-chart data=model.rmNode.getGpuDataForDonutChart + showLabels=true + parentId="gpu-donut-chart" + ratio=0.6 + colorTargets="good" + colorTargetReverse=true + maxHeight=350}} + </div> + </div> + </div> + </div> + {{/if}} + </div> + </div> +</div> +{{outlet}} http://git-wip-us.apache.org/repos/asf/hadoop/blob/aab43959/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/yarn-nm-gpu.hbs ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/yarn-nm-gpu.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/yarn-nm-gpu.hbs new file mode 100644 index 0000000..55840ad --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/yarn-nm-gpu.hbs @@ -0,0 +1,53 @@ +{{!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--}} + +{{breadcrumb-bar breadcrumbs=breadcrumbs}} + +<div class="col-md-12 container-fluid"> + <div class="row"> + + {{node-menu-panel path="yarn-node" nodeId=model.rmNode.id + nodeAddr=model.node.id nmGpuInfo=model.nmGpuInfo}} + + <div class="col-md-10 container-fluid"> + <div class="panel panel-default"> + <div class="panel-heading">Gpu Information</div> + <table class="table"> + <tbody> + <tr> + <td>Vendor</td> + <td>NVIDIA</td> + </tr> + <tr> + <td>Driver Version</td> + <td>{{model.nmGpuInfo.info.gpuDeviceInformation.driverVersion}}</td> + </tr> + <tr> + <td>Total Number Of Gpus</td> + <td>{{model.nmGpuInfo.info.totalGpuDevices.length}}</td> + </tr> + </tbody> + </table> + </div> + + {{#each model.nmGpuInfo.info.gpuDeviceInformation.gpus as |gpu|}} + {{yarn-nm-gpu-info gpu=gpu}} + {{/each}} + </div> + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/aab43959/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js index b9da222..74cc916 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js @@ -130,6 +130,57 @@ export default { } return value.toFixed(1) + " " + unit; }, + resourceToSimplifiedUnit: function (value, unit) { + // First convert unit to base unit (""). + var normalizedValue = value; + if (unit === "Ki") { + normalizedValue = normalizedValue * 1024; + } else if (unit === "Mi") { + normalizedValue = normalizedValue * 1024 * 1024; + } else if (unit === "Gi") { + normalizedValue = normalizedValue * 1024 * 1024 * 1024; + } else if (unit === "Ti") { + normalizedValue = normalizedValue * 1024 * 1024 * 1024 * 1024; + } else if (unit === "Pi") { + normalizedValue = normalizedValue * 1024 * 1024 * 1024 * 1024 * 1024; + } else if (unit === "K" || unit === "k") { + normalizedValue = normalizedValue * 1000; + } else if (unit === "M" || unit === "m") { + normalizedValue = normalizedValue * 1000 * 1000; + } else if (unit === "G" || unit === "g") { + normalizedValue = normalizedValue * 1000 * 1000 * 1000; + } else if (unit === "T" || unit === "t") { + normalizedValue = normalizedValue * 1000 * 1000 * 1000 * 1000; + } else if (unit === "P" || unit === "p") { + normalizedValue = normalizedValue * 1000 * 1000 * 1000 * 1000 * 1000; + } + + // From baseunit ("") convert to most human readable unit + // (which value < 1024 * 0.9). + var finalUnit = ""; + if (normalizedValue / 1024 >= 0.9) { + normalizedValue = normalizedValue / 1024; + finalUnit = "Ki"; + } + if (normalizedValue / 1024 >= 0.9) { + normalizedValue = normalizedValue / 1024; + finalUnit = "Mi"; + } + if (normalizedValue / 1024 >= 0.9) { + normalizedValue = normalizedValue / 1024; + finalUnit = "Gi"; + } + if (normalizedValue / 1024 >= 0.9) { + normalizedValue = normalizedValue / 1024; + finalUnit = "Ti"; + } + if (normalizedValue / 1024 >= 0.9) { + normalizedValue = normalizedValue / 1024; + finalUnit = "Pi"; + } + + return normalizedValue.toFixed(1) + " " + finalUnit; + }, msToElapsedTimeUnit: function(millisecs, short) { var seconds = Math.floor(millisecs / 1000); var days = Math.floor(seconds / (3600 * 24)); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org