YARN-3965. Add startup timestamp to nodemanager UI. Contributed by Hong Zhiguo
This commit is contained in:
parent
3cd02b9522
commit
469cfcd695
|
@ -361,6 +361,8 @@ Release 2.8.0 - UNRELEASED
|
||||||
YARN-3950. Add unique SHELL_ID environment variable to DistributedShell
|
YARN-3950. Add unique SHELL_ID environment variable to DistributedShell
|
||||||
(Robert Kanter via jlowe)
|
(Robert Kanter via jlowe)
|
||||||
|
|
||||||
|
YARN-3965. Add startup timestamp to nodemanager UI (Hong Zhiguo via jlowe)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
YARN-3339. TestDockerContainerExecutor should pull a single image and not
|
YARN-3339. TestDockerContainerExecutor should pull a single image and not
|
||||||
|
|
|
@ -81,6 +81,7 @@ public class NodeManager extends CompositeService
|
||||||
public static final int SHUTDOWN_HOOK_PRIORITY = 30;
|
public static final int SHUTDOWN_HOOK_PRIORITY = 30;
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(NodeManager.class);
|
private static final Log LOG = LogFactory.getLog(NodeManager.class);
|
||||||
|
private static long nmStartupTime = System.currentTimeMillis();
|
||||||
protected final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
protected final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
||||||
private ApplicationACLsManager aclsManager;
|
private ApplicationACLsManager aclsManager;
|
||||||
private NodeHealthCheckerService nodeHealthChecker;
|
private NodeHealthCheckerService nodeHealthChecker;
|
||||||
|
@ -101,6 +102,10 @@ public class NodeManager extends CompositeService
|
||||||
super(NodeManager.class.getName());
|
super(NodeManager.class.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getNMStartupTime() {
|
||||||
|
return nmStartupTime;
|
||||||
|
}
|
||||||
|
|
||||||
protected NodeStatusUpdater createNodeStatusUpdater(Context context,
|
protected NodeStatusUpdater createNodeStatusUpdater(Context context,
|
||||||
Dispatcher dispatcher, NodeHealthCheckerService healthChecker) {
|
Dispatcher dispatcher, NodeHealthCheckerService healthChecker) {
|
||||||
return new NodeStatusUpdaterImpl(context, dispatcher, healthChecker,
|
return new NodeStatusUpdaterImpl(context, dispatcher, healthChecker,
|
||||||
|
|
|
@ -73,15 +73,17 @@ public class NodePage extends NMView {
|
||||||
StringUtils.byteDesc(info.getTotalPmemAllocated() * BYTES_IN_MB))
|
StringUtils.byteDesc(info.getTotalPmemAllocated() * BYTES_IN_MB))
|
||||||
._("Pmem enforcement enabled",
|
._("Pmem enforcement enabled",
|
||||||
info.isPmemCheckEnabled())
|
info.isPmemCheckEnabled())
|
||||||
._("Total VCores allocated for Containers",
|
._("Total VCores allocated for Containers",
|
||||||
String.valueOf(info.getTotalVCoresAllocated()))
|
String.valueOf(info.getTotalVCoresAllocated()))
|
||||||
._("NodeHealthyStatus",
|
._("NodeHealthyStatus",
|
||||||
info.getHealthStatus())
|
info.getHealthStatus())
|
||||||
._("LastNodeHealthTime", new Date(
|
._("LastNodeHealthTime", new Date(
|
||||||
info.getLastNodeUpdateTime()))
|
info.getLastNodeUpdateTime()))
|
||||||
._("NodeHealthReport",
|
._("NodeHealthReport",
|
||||||
info.getHealthReport())
|
info.getHealthReport())
|
||||||
._("Node Manager Version:", info.getNMBuildVersion() +
|
._("NodeManager started on", new Date(
|
||||||
|
info.getNMStartupTime()))
|
||||||
|
._("NodeManager Version:", info.getNMBuildVersion() +
|
||||||
" on " + info.getNMVersionBuiltOn())
|
" on " + info.getNMVersionBuiltOn())
|
||||||
._("Hadoop Version:", info.getHadoopBuildVersion() +
|
._("Hadoop Version:", info.getHadoopBuildVersion() +
|
||||||
" on " + info.getHadoopVersionBuiltOn());
|
" on " + info.getHadoopVersionBuiltOn());
|
||||||
|
|
|
@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.apache.hadoop.util.VersionInfo;
|
import org.apache.hadoop.util.VersionInfo;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.Context;
|
import org.apache.hadoop.yarn.server.nodemanager.Context;
|
||||||
|
import org.apache.hadoop.yarn.server.nodemanager.NodeManager;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.ResourceView;
|
import org.apache.hadoop.yarn.server.nodemanager.ResourceView;
|
||||||
import org.apache.hadoop.yarn.util.YarnVersionInfo;
|
import org.apache.hadoop.yarn.util.YarnVersionInfo;
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ public class NodeInfo {
|
||||||
protected String hadoopVersionBuiltOn;
|
protected String hadoopVersionBuiltOn;
|
||||||
protected String id;
|
protected String id;
|
||||||
protected String nodeHostName;
|
protected String nodeHostName;
|
||||||
|
protected long nmStartupTime;
|
||||||
|
|
||||||
public NodeInfo() {
|
public NodeInfo() {
|
||||||
} // JAXB needs this
|
} // JAXB needs this
|
||||||
|
@ -77,6 +79,7 @@ public class NodeInfo {
|
||||||
this.hadoopVersion = VersionInfo.getVersion();
|
this.hadoopVersion = VersionInfo.getVersion();
|
||||||
this.hadoopBuildVersion = VersionInfo.getBuildVersion();
|
this.hadoopBuildVersion = VersionInfo.getBuildVersion();
|
||||||
this.hadoopVersionBuiltOn = VersionInfo.getDate();
|
this.hadoopVersionBuiltOn = VersionInfo.getDate();
|
||||||
|
this.nmStartupTime = NodeManager.getNMStartupTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNodeId() {
|
public String getNodeId() {
|
||||||
|
@ -143,4 +146,7 @@ public class NodeInfo {
|
||||||
return this.pmemCheckEnabled;
|
return this.pmemCheckEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getNMStartupTime() {
|
||||||
|
return nmStartupTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ public class TestNMWebServices extends JerseyTestBase {
|
||||||
public void verifyNodeInfo(JSONObject json) throws JSONException, Exception {
|
public void verifyNodeInfo(JSONObject json) throws JSONException, Exception {
|
||||||
assertEquals("incorrect number of elements", 1, json.length());
|
assertEquals("incorrect number of elements", 1, json.length());
|
||||||
JSONObject info = json.getJSONObject("nodeInfo");
|
JSONObject info = json.getJSONObject("nodeInfo");
|
||||||
assertEquals("incorrect number of elements", 16, info.length());
|
assertEquals("incorrect number of elements", 17, info.length());
|
||||||
verifyNodeInfoGeneric(info.getString("id"), info.getString("healthReport"),
|
verifyNodeInfoGeneric(info.getString("id"), info.getString("healthReport"),
|
||||||
info.getLong("totalVmemAllocatedContainersMB"),
|
info.getLong("totalVmemAllocatedContainersMB"),
|
||||||
info.getLong("totalPmemAllocatedContainersMB"),
|
info.getLong("totalPmemAllocatedContainersMB"),
|
||||||
|
|
Loading…
Reference in New Issue