@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        response.setHeader("Edge-control", "no-store");
        if ("clear".equalsIgnoreCase(request.getParameter("clear"))) {
            tistat.clear();
        }
        ServletOutputStream out = response.getOutputStream();
        String datestr = getHostName() + " - " + (new SimpleDateFormat("yyyyMMdd - HHmmss")).format(new Date());
        //
        // xml
        if (request.getParameter("memxml") != null) {
            memoryXml(out, tistat.getMemoryInfo().getValues(), 1, "JVM Memory - " + datestr);
            out.flush();
            return;
        } else if (request.getParameter("histxml") != null) {
            memoryXml(out, tistat.getResponseTimes(), 1, "Response Histogram - " + datestr);
            out.flush();
            return;
        }
        //
        // html
        if (request.getParameter("qon") != null) {
            tistat.setAddQueryToKey(true);
        } else if (request.getParameter("qoff") != null) {
            tistat.setAddQueryToKey(false);
        }
        String sort = request.getParameter("sort");
        String baseurl = request.getRequestURI();
        if (request.getParameter("freq") != null) {
            NumberFormat nf0 = NumberFormat.getInstance();
            nf0.setMaximumFractionDigits(0);
            nf0.setMinimumFractionDigits(0);
            header(NAME + " - Frequency - " + datestr, false, out);
            baseurl += "?freq=Frequency";
            frequencyTable(out, tistat, sort, baseurl);
            String title1 = " Response " + nf0.format(tistat.getAverage()) + " [ms]";
            pixelPlot(out, tistat.getResponseTimes(), 0, "red", 55, title1);
            String title2 = "Bitrate " + nf0.format(tistat.getBitrateAverage() / 1024D) + " [KB/s]";
            pixelPlot(out, tistat.getRatesSizes(), 1, "blue", 270, title2);
            footer(out);
        } else if (request.getParameter("mem") != null) {
            header(NAME + " - JVM Memory - " + datestr, true, out);
            String title = "JVM Memory";
            pixelPlot(out, tistat.getMemoryInfo().getValues(), 1, "navy", 60, title);
            footer(out);
        } else if (request.getParameter("payload") != null) {
            header(NAME + " - Payload Histogram - " + datestr, false, out);
            String title = "Payload";
            pixelPlot(out, tistat.getChunkSizes(), 0, "green", 60, title);
            footer(out);
        } else {
            boolean reload = false;
            if (request.getParameter("reload") != null) {
                reload = true;
            }
            NumberFormat nf0 = NumberFormat.getInstance();
            nf0.setMaximumFractionDigits(0);
            nf0.setMinimumFractionDigits(0);
            header(NAME + " - Performance - " + datestr, reload, out);
            baseurl += "?stat=Performance";
            statisticsTable(out, tistat, "X", null, sort, baseurl);
            String title1 = " Response " + nf0.format(tistat.getAverage()) + " [ms]";
            pixelPlot(out, tistat.getResponseTimes(), 0, "red", 55, title1);
            String title2 = "Bitrate " + nf0.format(tistat.getBitrateAverage() / 1024D) + " [KB/s]";
            pixelPlot(out, tistat.getRatesSizes(), 1, "blue", 270, title2);
            footer(out);
        }
        out.flush();
    }