<commit_before>package net.ttddyy.dsproxy.support;

import net.ttddyy.dsproxy.QueryCount;
import net.ttddyy.dsproxy.QueryCountHolder;
import net.ttddyy.dsproxy.listener.CommonsLogLevel;

import javax.servlet.ServletContext;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import java.util.Collections;
import java.util.List;

/**
 * @author <NAME>
 * @since 1.3
 */
public abstract class AbstractQueryCountLoggingRequestListener implements ServletRequestListener {
    private QueryCountLogFormatter logFormatter = new DefaultQueryCountLogFormatter();
    private boolean writeAsJson = false;

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        // No-op
    }

    @Override
    public void requestDestroyed(ServletRequestEvent sre) {

        List<String> dsNames = QueryCountHolder.getDataSourceNamesAsList();
        Collections.sort(dsNames);<commit_msg>clean up import<commit_after>package net.ttddyy.dsproxy.support;

import net.ttddyy.dsproxy.QueryCount;
import net.ttddyy.dsproxy.QueryCountHolder;

import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import java.util.Collections;
import java.util.List;

/**
 * @author <NAME>
 * @since 1.3
 */
public abstract class AbstractQueryCountLoggingRequestListener implements ServletRequestListener {
    private QueryCountLogFormatter logFormatter = new DefaultQueryCountLogFormatter();
    private boolean writeAsJson = false;

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        // No-op
    }

    @Override
    public void requestDestroyed(ServletRequestEvent sre) {

        List<String> dsNames = QueryCountHolder.getDataSourceNamesAsList();
        Collections.sort(dsNames);
{'fraction_non_alphanumeric': 0.08088642659279778, 'fraction_numerical': 0.00221606648199446, 'mean_word_length': 4.96039603960396, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5111066', 'n_tokens_mistral': 490, 'n_tokens_neox': 483, 'n_words': 101}