org.apache.hadoop.hbase.generated.master.processMaster_jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbase-server Show documentation
Show all versions of hbase-server Show documentation
Server functionality for HBase
package org.apache.hadoop.hbase.generated.master;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Date;
import java.util.List;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.RuntimeMXBean;
import java.lang.management.GarbageCollectorMXBean;
import org.apache.hadoop.hbase.util.JSONMetricUtil;
import org.apache.hadoop.hbase.procedure2.util.StringUtils;
import org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
public final class processMaster_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write('\n');
out.write('\n');
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
ObjectName jvmMetrics = new ObjectName("Hadoop:service=HBase,name=JvmMetrics");
// There is always two of GC collectors
List gcBeans = JSONMetricUtil.getGcCollectorBeans();
GarbageCollectorMXBean collector1 = null;
GarbageCollectorMXBean collector2 = null;
try {
collector1 = gcBeans.get(0);
collector2 = gcBeans.get(1);
} catch(IndexOutOfBoundsException e) {}
List mPools = JSONMetricUtil.getMemoryPools();
pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID());
out.write('\n');
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "header.jsp" + "?" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("pageTitle", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageTitle}", java.lang.String.class, (PageContext)_jspx_page_context, null), request.getCharacterEncoding()), out, false);
out.write("\n\n\n \n \n ");
out.print( JSONMetricUtil.getCommmand().split(" ")[0] );
out.write("
\n \n \n \n \n Started \n Uptime \n PID \n Owner \n \n \n \n ");
out.print( new Date(runtimeBean.getStartTime()) );
out.write(" \n ");
out.print( StringUtils.humanTimeDiff(runtimeBean.getUptime()) );
out.write(" \n ");
out.print( JSONMetricUtil.getProcessPID() );
out.write(" \n ");
out.print( runtimeBean.getSystemProperties().get("user.name") );
out.write(" \n \n
\n\n\n \n \n Threads
\n \n \n \n \n ThreadsNew \n ThreadsRunable \n ThreadsBlocked \n ThreadsWaiting \n ThreadsTimeWaiting \n ThreadsTerminated \n \n \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsNew") );
out.write(" \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsRunnable"));
out.write(" \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsBlocked"));
out.write(" \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsWaiting"));
out.write(" \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTimedWaiting"));
out.write(" \n ");
out.print( JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTerminated"));
out.write(" \n \n
\n\n\n \n \n GC Collectors
\n \n \n ");
if (gcBeans.size() == 2) {
out.write("\n\n \n - \n ");
out.print(collector1.getName() );
out.write("\n
\n - \n ");
out.print(collector2.getName() );
out.write("\n
\n
\n \n \n \n \n Collection Count \n Collection Time \n Last duration \n \n \n ");
out.print( collector1.getCollectionCount() );
out.write(" \n ");
out.print( StringUtils.humanTimeDiff(collector1.getCollectionTime()) );
out.write(" \n ");
out.print( StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector1.getObjectName())) );
out.write(" \n \n
\n \n \n \n \n Collection Count \n Collection Time \n Last duration \n \n \n ");
out.print( collector2.getCollectionCount() );
out.write(" \n ");
out.print( StringUtils.humanTimeDiff(collector2.getCollectionTime()) );
out.write(" \n ");
out.print( StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector2.getObjectName())) );
out.write(" \n \n
\n \n \n \n ");
} else {
out.write("\n Can not display GC Collector stats.
\n ");
}
out.write("\n Total GC Collection time: ");
out.print( StringUtils.humanTimeDiff(collector1.getCollectionTime() +
collector2.getCollectionTime()));
out.write("\n\n");
for(MemoryPoolMXBean mp:mPools) {
if(mp.getName().contains("Cache")) continue;
out.write("\n\n \n \n ");
out.print( mp.getName() );
out.write("
\n \n \n \n \n Commited \n Init \n Max \n Used \n Utilization [%] \n \n \n \n ");
out.print( TraditionalBinaryPrefix.long2String(mp.getUsage().getCommitted(), "B", 1) );
out.write(" \n ");
out.print( TraditionalBinaryPrefix.long2String(mp.getUsage().getInit(), "B", 1) );
out.write(" \n ");
out.print( TraditionalBinaryPrefix.long2String(mp.getUsage().getMax(), "B", 1) );
out.write(" \n ");
out.print( TraditionalBinaryPrefix.long2String(mp.getUsage().getUsed(), "B", 1) );
out.write(" \n ");
out.print( JSONMetricUtil.calcPercentage(mp.getUsage().getUsed(),
mp.getUsage().getCommitted()) );
out.write(" \n \n
\n\n");
}
out.write('\n');
out.write('\n');
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "footer.jsp", out, false);
out.write('\n');
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}