Exemplo n.º 1
0
        //--------------------------------------------------------------------------------------------------------------------------------------------------------------
        public static void PerformanceTestMySQLRead()
        {
            Logger.LogSubHeading("Testing MySQL Threaded!");

            bool success = false;

            Logger.Log("Now starting to test the patterns");
            DateTime readStart = DateTime.Now;

            if (TestParameters.UseThreading == false)
            {
                PerformanceTestMySQLThreadBlock(TestParameters.NumSearchPatterns, 0);
            }
            else
            {
                //bool success = DNThreadManager.Run("RedisRead", NumIterations, 2500, new Action<int, int>( PerformanceTestRedisRead));
                success = DNThreadManager.Run("MySQLRead", TestParameters.NumSearchPatterns, PerformanceTestMySQLThreadBlock);
            }

            Logger.Log("Found " + IDs.Count + " objects matching one or more of the search patterns ...");

            TestParameters.ReadMySQL = DateTime.Now.Subtract(readStart);
            Logger.Log("MySQL read testing completed");

            // clean up the static variables to minimise memory usage
            IDs = new HashSet <uint>();
        }
Exemplo n.º 2
0
        //--------------------------------------------------------------------------------------------------------------------------------------------------------------
        public static void RunMySQLSearchingTest()
        {
            //-----1----- MySQL
            Logger.LogSubHeading("Now testing the MySQL to get a benchmark ...");
            DateTime MySQLTest = DateTime.Now;

            if (TestParameters.UseThreading == false)
            {
                PerformanceTestMySQLThreadBlock(TestParameters.NumSearchPatterns, 0);
            }
            else
            {
                //bool success = DNThreadManager.Run("RedisRead", NumIterations, 2500, new Action<int, int>( PerformanceTestRedisRead));
                bool success = DNThreadManager.Run("MySQLRead", TestParameters.NumSearchPatterns, PerformanceTestMySQLThreadBlock);
            }

            TimeSpan MySQLTested = DateTime.Now.Subtract(MySQLTest);

            Logger.Log("");
            Logger.Log("Time to process:" + MySQLTested.TotalSeconds);

            Logger.Log("Found " + IDs.Count + " objects matching one or more of the search patterns ...");

            Logger.Log("MySQL read testing completed");

            // clean up the static variables to minimise memory usage
            IDs = new HashSet <uint>();
        }
Exemplo n.º 3
0
        //--------------------------------------------------------------------------------------------------------------------------------------------------------------
        public static void PerformanceTestRedisCSharp()
        {
            bool success = false;

            Logger.LogSubHeading("Testing Redis with C Sharp checks!");
            Logger.Log("Reading data (including loading all the object into memory in the first place!)");
            DateTime readStart = DateTime.Now;

            // Read the data from the DB ...
            Logger.Log("Getting all the objects...");
            List <object> objs = rw.GetAllObjects(new TestObj());

            TestParameters.AllObjects = TestObj.ParseList(objs);
            Logger.Log("Extracted " + TestParameters.AllObjects.Count + " objects...");

            IDs = new HashSet <uint>();

            // And now do the pattern matching - no need to set a specific chunk size for these ones ...
            Logger.Log("Starting threaded processing ...");
            if (TestParameters.UseThreading == true)
            {
                success = DNThreadManager.Run("RedisCSharp", TestParameters.PatternsToSearchFor.Count, PerformanceTestRedisCSharpThreadBlock);
            }
            else
            {
                PerformanceTestRedisCSharpThreadBlock(TestParameters.PatternsToSearchFor.Count, 0);
            }

            Logger.Log("Found " + IDs.Count + " objects matching one or more of the search patterns ...");

            TestParameters.ReadRedisCSharp = DateTime.Now.Subtract(readStart);
            Logger.Log("Redis with CSharp tests completed");

            // clean up the static variables to minimise memory usage
            IDs = new HashSet <uint>();
        }