// Path: src/main/java/com/github/davidmoten/logan/servlet/ServletUtil.java
// public static long getMandatoryLong(HttpServletRequest req, String name) {
//     if (req.getParameter(name) == null)
//         throw new RuntimeException("parameter '" + name + "' is mandatory");
//     else
//         try {
//             return Long.parseLong(req.getParameter(name));
//         } catch (NumberFormatException e) {
//             throw new RuntimeException(
//                     "parameter '" + name + "' could not be parsed as a Long: " + req.getParameter(name), e);
//         }
// }


import static com.github.davidmoten.logan.servlet.ServletUtil.getMandatoryLong;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
package com.github.davidmoten.logan.servlet;




//@WebServlet(urlPatterns = { "/log" })
public class LogServlet extends HttpServlet {

    private static final long serialVersionUID = 1L;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        long startTime = getMandatoryLong(req, "start");
        long finishTime = getMandatoryLong(req, "finish");
// Path: src/main/java/com/github/davidmoten/logan/servlet/ServletUtil.java
// public static long getMandatoryLong(HttpServletRequest req, String name) {
//     if (req.getParameter(name) == null)
//         throw new RuntimeException("parameter '" + name + "' is mandatory");
//     else
//         try {
//             return Long.parseLong(req.getParameter(name));
//         } catch (NumberFormatException e) {
//             throw new RuntimeException(
//                     "parameter '" + name + "' could not be parsed as a Long: " + req.getParameter(name), e);
//         }
// }


// Path: src/main/java/com/github/davidmoten/logan/servlet/LogServlet.java
import static com.github.davidmoten.logan.servlet.ServletUtil.getMandatoryLong;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

package com.github.davidmoten.logan.servlet;




//@WebServlet(urlPatterns = { "/log" })
public class LogServlet extends HttpServlet {

    private static final long serialVersionUID = 1L;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        long startTime = getMandatoryLong(req, "start");
        long finishTime = getMandatoryLong(req, "finish");
        resp.setContentType("text/plain");