package ru.yandex.webmaster3.core.http.monitoring;

import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import ru.yandex.webmaster3.core.metrics.ThreadDumpServlet;

/**
 * @author aherman
 */
public class MonitoringServletRegistrar {
    public AbstractHandler createMonitoringHandler() {
        ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
        servletContextHandler.setContextPath("/monitoring");

        servletContextHandler.addServlet(ThreadDumpServlet.class, "/thread-dump");
        servletContextHandler.addServlet(PingServantlet.class, "/ping");

        return servletContextHandler;
    }
}
