<commit_before>package com.emc.mongoose;

import io.prometheus.client.exporter.MetricsServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

import java.util.Arrays;

/**
 @author <NAME>. on 05.10.18 */
public class Server {

	final org.eclipse.jetty.server.Server server;

	public Server() {
		this(1234);  //default port
	}

	public Server(final int port) {
		server = new org.eclipse.jetty.server.Server(port);
		ServletContextHandler context = new ServletContextHandler();
		context.setContextPath("/");
		server.setHandler(context);
		context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics");
	}

	public Server start() {
		try {
			server.start();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return this;
	}

	public void stop() {
		try {
			server.stop();
			Arrays.asList(server.getChildHandlers()).stream().peek(handler -> {
				try {
					handler.stop();
				} catch(Exception e) {
					e.printStackTrace();
				}
			});
		} catch(Exception e) {
			e.printStackTrace();
		}
	}<commit_msg>Revert: save [skip ci]<commit_after>package com.emc.mongoose;

import io.prometheus.client.exporter.MetricsServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

/**
 @author <NAME>. on 05.10.18 */
public class Server {

	final org.eclipse.jetty.server.Server server;

	public Server() {
		this(1234);  //default port
	}

	public Server(final int port) {
		server = new org.eclipse.jetty.server.Server(port);
		ServletContextHandler context = new ServletContextHandler();
		context.setContextPath("/");
		server.setHandler(context);
		context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics");
	}

	public Server start() {
		try {
			server.start();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return this;
	}

	public void stop() {
		try {
			server.stop();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.010095911155981827, 'mean_word_length': 3.942643391521197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7578163', 'n_tokens_mistral': 719, 'n_tokens_neox': 632, 'n_words': 127}