<commit_before>/**
 * Copyright 2013 <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 org.vibur.dbcp.perf;

import org.vibur.dbcp.ViburDBCPDataSource;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author <NAME>
 */
public class ViburDBCPGetConnectionTestPerf {

    // pool metrics:
    private static final int INITIAL_SIZE = 10;
    private static final int MAX_SIZE = 100;
    private static final long TIMEOUT_MS = 5000;
    private static final boolean FAIR = true;

    private static final int ITERATIONS = 100;
    private static final int THREADS_COUNT = 500;
    private static final long DO_WORK_FOR_MS = 10;

    public static void main(String[] args) {

        // Creates a DataSource with INITIAL_SIZE and MAX_SIZE, and starts THREADS_COUNT threads where each thread
        // calls ITERATIONS times getConnection() and after TIMEOUT_MS close() operation on an object from the
        // DataSource. Each getConnection() call has TIMEOUT in ms and the number of unsuccessful calls is recorded.
        // Measures and reports the total time taken by the test in ms.

        final ViburDBCPDataSource ds = createDataSource();
        ds.start();

        long start = System.currentTimeMillis();
        final AtomicInteger unsuccessful = new AtomicInteger(0);<commit_msg>comment fix<commit_after>/**
 * Copyright 2013 <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 org.vibur.dbcp.perf;

import org.vibur.dbcp.ViburDBCPDataSource;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author <NAME>
 */
public class ViburDBCPGetConnectionTestPerf {

    // pool metrics:
    private static final int INITIAL_SIZE = 10;
    private static final int MAX_SIZE = 100;
    private static final long TIMEOUT_MS = 5000;
    private static final boolean FAIR = true;

    private static final int ITERATIONS = 100;
    private static final int THREADS_COUNT = 500;
    private static final long DO_WORK_FOR_MS = 10;

    public static void main(String[] args) {

        // Creates a DataSource with INITIAL_SIZE and MAX_SIZE, and starts THREADS_COUNT threads where each thread
        // calls ITERATIONS times getConnection() and then after TIMEOUT_MS close() method on an object from the
        // DataSource. Each getConnection() call has TIMEOUT in ms and the number of unsuccessful calls is recorded.
        // Measures and reports the total time taken by the test in ms.

        final ViburDBCPDataSource ds = createDataSource();
        ds.start();

        long start = System.currentTimeMillis();
        final AtomicInteger unsuccessful = new AtomicInteger(0);
{'fraction_non_alphanumeric': 0.07040762308099524, 'fraction_numerical': 0.013763896241397565, 'mean_word_length': 3.4511189634864547, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7322088', 'n_tokens_mistral': 1051, 'n_tokens_neox': 990, 'n_words': 431}