<commit_before>package com.boxfuse.cloudwatchlogs.logback;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggingEvent;
import com.amazonaws.services.logs.AWSLogs;
import com.amazonaws.services.logs.model.PutLogEventsRequest;
import com.amazonaws.services.logs.model.PutLogEventsResult;
import com.boxfuse.cloudwatchlogs.CloudwatchLogsConfig;
import com.boxfuse.cloudwatchlogs.internal.CloudwatchLogsLogEventPutter;
import org.junit.Test;

import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class CloudwatchLogsLogbackAppenderMediumTest {
    private static final int NUM_THREADS = 10;
    private static final int EVENTS_PER_THREAD = 100000;

    @Test(timeout = 10000)
    public void concurrencyAndThroughput() throws InterruptedException {
        final AWSLogs awsLogs = mock(AWSLogs.class);
        when(awsLogs.putLogEvents(any(PutLogEventsRequest.class))).thenReturn(new PutLogEventsResult());
        final CloudwatchLogsLogbackAppender appender = new CloudwatchLogsLogbackAppender() {
            @Override
            CloudwatchLogsLogEventPutter createCloudwatchLogsLogEventPutter() {
                return new CloudwatchLogsLogEventPutter(config, eventQueue, awsLogs, true);
            }
        };
        appender.setConfig(new CloudwatchLogsConfig());
        appender.start();

        ExecutorService executorService = Executors.newFixedThreadPool(NUM_THREADS);<commit_msg>Prevent TravisCI timeout<commit_after>package com.boxfuse.cloudwatchlogs.logback;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggingEvent;
import com.amazonaws.services.logs.AWSLogs;
import com.amazonaws.services.logs.model.PutLogEventsRequest;
import com.amazonaws.services.logs.model.PutLogEventsResult;
import com.boxfuse.cloudwatchlogs.CloudwatchLogsConfig;
import com.boxfuse.cloudwatchlogs.internal.CloudwatchLogsLogEventPutter;
import org.junit.Test;

import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class CloudwatchLogsLogbackAppenderMediumTest {
    private static final int NUM_THREADS = 10;
    private static final int EVENTS_PER_THREAD = 100000;

    @Test(timeout = 15000)
    public void concurrencyAndThroughput() throws InterruptedException {
        final AWSLogs awsLogs = mock(AWSLogs.class);
        when(awsLogs.putLogEvents(any(PutLogEventsRequest.class))).thenReturn(new PutLogEventsResult());
        final CloudwatchLogsLogbackAppender appender = new CloudwatchLogsLogbackAppender() {
            @Override
            CloudwatchLogsLogEventPutter createCloudwatchLogsLogEventPutter() {
                return new CloudwatchLogsLogEventPutter(config, eventQueue, awsLogs, true);
            }
        };
        appender.setConfig(new CloudwatchLogsConfig());
        appender.start();

        ExecutorService executorService = Executors.newFixedThreadPool(NUM_THREADS);
{'fraction_non_alphanumeric': 0.08471248246844319, 'fraction_numerical': 0.0072931276297335205, 'mean_word_length': 4.8363338788870704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2899402', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1055, 'n_words': 181}