<commit_before>﻿using EventCentric.MicroserviceFactory;
using Microsoft.Practices.Unity;
using System;

namespace PersistenceBenchmark.ConsoleHost
{
    public class Program
    {
        public static bool VerboseIsEnabled = false;

        static void Main(string[] args)
        {
            var plugin = DbManager.SelectedPlugin;

            PrintWelcomeMessage(plugin);

            DbManager.ResetDbs(plugin);
            var mainContainer = UnityConfig.GetConfiguredContainer(plugin);

            var user1App = UnityConfig.UserContainer1.Resolve<UserAppService>();
            var user2App = UnityConfig.UserContainer2.Resolve<UserAppService>();

            // Holding in memory messages
            // Expected: Events: waves * users * 2;

            Console.WriteLine("Press enter to start....");
            Console.ReadLine();

            // THIS MAKE CRASH, ALMOST

            // SQL SERVER ORM -------------------------------------------------
            // 50 througput,    completes in 2:48 m 10.000 messages    60 m/s
            // 100 througput,   completes in 4:44 m 20.000 messages    70 m/s

            // SQL SERVER ADO.NET ---------------------------------------------
            // 100 througput,   completes in 1:48 m 20.000 messages    185 m/s

            // IN-MEMORY-------------------------------------------------------
            // 100 througput,   completes in 0:28 s 20.000 messgaes    714 m/s
            user1App.StressWithWavesOfConcurrentUsers(wavesCount: 5, concurrentUsers: 1000);
            user2App.StressWithWavesOfConcurrentUsers(wavesCount: 5, concurrentUsers: 1000);

            // Light
            //user1App.StressWithWavesOfConcurrentUsers(wavesCount: 1, concurrentUsers: 1);
            //user2App.StressWithWavesOfConcurrentUsers(wavesCount: 1, concurrentUsers: 1);

            Console.WriteLine("Press enter to stop and clean...");
            Console.ReadLine();
            if (plugin == PersistencePlugin.InMemory)
                UnityConfig.StatsMonitor.PrintStats();<commit_msg>performance test is disabled<commit_after>﻿using EventCentric.MicroserviceFactory;
using Microsoft.Practices.Unity;
using System;

namespace PersistenceBenchmark.ConsoleHost
{
    public class Program
    {
        public static bool VerboseIsEnabled = false;

        static void Main(string[] args)
        {
            var plugin = DbManager.SelectedPlugin;

            PrintWelcomeMessage(plugin);

            //DbManager.ResetDbs(plugin);
            var mainContainer = UnityConfig.GetConfiguredContainer(plugin);

            var user1App = UnityConfig.UserContainer1.Resolve<UserAppService>();
            var user2App = UnityConfig.UserContainer2.Resolve<UserAppService>();

            // Holding in memory messages
            // Expected: Events: waves * users * 2;

            Console.WriteLine("Press enter to start....");
            Console.ReadLine();

            // THIS MAKE CRASH, ALMOST

            // SQL SERVER ORM -------------------------------------------------
            // 50 througput,    completes in 2:48 m 10.000 messages    60 m/s
            // 100 througput,   completes in 4:44 m 20.000 messages    70 m/s

            // SQL SERVER ADO.NET ---------------------------------------------
            // 100 througput,   completes in 1:48 m 20.000 messages    185 m/s

            // IN-MEMORY-------------------------------------------------------
            // 100 througput,   completes in 0:28 s 20.000 messgaes    714 m/s
            //user1App.StressWithWavesOfConcurrentUsers(wavesCount: 5, concurrentUsers: 1000);
            //user2App.StressWithWavesOfConcurrentUsers(wavesCount: 5, concurrentUsers: 1000);

            // Light
            //user1App.StressWithWavesOfConcurrentUsers(wavesCount: 1, concurrentUsers: 1);
            //user2App.StressWithWavesOfConcurrentUsers(wavesCount: 1, concurrentUsers: 1);

            Console.WriteLine("Press enter to stop and clean...");
            Console.ReadLine();
            if (plugin == PersistencePlugin.InMemory)
                UnityConfig.StatsMonitor.PrintStats();
{'fraction_non_alphanumeric': 0.1541070995880785, 'fraction_numerical': 0.03683062757450933, 'mean_word_length': 1.7051114023591087, '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': '674272', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1012, 'n_words': 256}