private static long START_TIME;
public void run(String[] args) {
Monitor.START_TIME = System.currentTimeMillis();
int port = ServerConfiguration.getSystemConfiguration().getPort(Property.MONITOR_PORT);
EmbeddedWebServer server;
try {
log.debug("Creating monitor on port " + port);
server = EmbeddedWebServer.create(port);
} catch (Throwable ex) {
log.error("Unable to start embedded web server", ex);
throw new RuntimeException(ex);
}
server.addServlet(DefaultServlet.class, "/");
server.addServlet(OperationServlet.class, "/op");
server.addServlet(MasterServlet.class, "/master");
server.addServlet(TablesServlet.class, "/tables");
server.addServlet(TServersServlet.class, "/tservers");
server.addServlet(LoggersServlet.class, "/loggers");
server.addServlet(ProblemServlet.class, "/problems");
server.addServlet(GcStatusServlet.class, "/gc");
server.addServlet(LogServlet.class, "/log");
server.addServlet(XMLServlet.class, "/xml");
server.addServlet(VisServlet.class, "/vis");
server.addServlet(Summary.class, "/trace/summary");
server.addServlet(ListType.class, "/trace/listType");
server.addServlet(ShowTrace.class, "/trace/show");
LogService.startLogListener();
server.start();
new Daemon(new LoggingRunnable(log, new ZooKeeperStatus()), "ZooKeeperStatus").start();
// need to regularly fetch data so plot data is updated
new Daemon(new LoggingRunnable(log, new Runnable() {