<commit_before>/*
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package net.uncontended.precipice.reporting;

import io.undertow.Undertow;
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.handlers.resource.ClassPathResourceManager;
import org.HdrHistogram.Histogram;

import java.util.concurrent.TimeUnit;

import static io.undertow.Handlers.resource;

public class Entry {

    public static void main(String[] args) {
//        PathHandler path = new PathHandler()
//                .addPrefixPath("/", resource(new ClassPathResourceManager(Dashboard.class.getClassLoader(),
//                        Dashboard.class.getPackage())).addWelcomeFiles("chart.html"))
//                .addExactPath("/api", new Dashboard());
//
//        Undertow server = Undertow.builder()
//                .addHttpListener(6001, "127.0.0.1")
//                .setHandler(path)
//                .build();
//        server.start();
//
//        try {
//            Thread.sleep(1000000000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        server.stop();

        Histogram histogram = new Histogram(1000, TimeUnit.HOURS.toNanos(1), 2);
        histogram.recordValue(2);
        histogram.recordValue(2);
        histogram.recordValue(2);
        histogram.recordValue(2);
        histogram.recordValue(2000);
        histogram.recordValue(3000);
        histogram.recordValue(5000);
        histogram.recordValue(TimeUnit.HOURS.toNanos(1));

        System.out.println(histogram.getValueAtPercentile(50.0));
        System.out.println(histogram.getValueAtPercentile(90.0));
        System.out.println(histogram.getValueAtPercentile(99.0));
        System.out.println(histogram.getValueAtPercentile(99.9));
        System.out.println(histogram.getValueAtPercentile(99.99));
        System.out.println(histogram.getValueAtPercentile(99.999));
        System.out.println(histogram.getMaxValue());

        histogram.outputPercentileDistribution(System.out, 1000.0);
    }
}
<commit_msg>Undo file change<commit_after>/*
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package net.uncontended.precipice.reporting;

import io.undertow.Undertow;
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.handlers.resource.ClassPathResourceManager;

import static io.undertow.Handlers.resource;

public class Entry {

    public static void main(String[] args) {
        PathHandler path = new PathHandler()
                .addPrefixPath("/", resource(new ClassPathResourceManager(Dashboard.class.getClassLoader(),
                        Dashboard.class.getPackage())).addWelcomeFiles("chart.html"))
                .addExactPath("/api", new Dashboard());

        Undertow server = Undertow.builder()
                .addHttpListener(6001, "127.0.0.1")
                .setHandler(path)
                .build();
        server.start();

        try {
            Thread.sleep(1000000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        server.stop();
    }
}

{'fraction_non_alphanumeric': 0.1134070158577607, 'fraction_numerical': 0.02522825564632388, 'mean_word_length': 2.8262867647058822, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 2, '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': '5137188', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1131, 'n_words': 283}