Exemple #1
0
        /// <summary>
        /// YCSB async benchmark test on Cassandra with partitions
        /// </summary>
        /// <param name="args"></param>
        static void YCSBAsyncTestWithPartitionedCassandraVersionDb(string[] args)
        {
            BenchmarkTestConfig config = new BenchmarkTestConfig(args);

            int replicationFactor = 3;

            ConsistencyLevel consistencyLevel = ConsistencyLevel.Quorum;

            string[] tables =
            {
                YCSBAsyncBenchmarkTest.TABLE_ID,
                VersionDb.TX_TABLE
            };

            PartitionedCassandraVersionDb versionDb = PartitionedCassandraVersionDb.Instance(config.WorkerCount,
                                                                                             config.Host, replicationFactor, consistencyLevel);
            YCSBAsyncBenchmarkTest test = new YCSBAsyncBenchmarkTest(config.RecordCount, config.WorkerCount,
                                                                     config.WorkloadCount, versionDb, tables, config);

            if (config.LoadRecords)
            {
                test.load(versionDb, config.WorkerCount, config.RecordCount);
            }
            else
            {
                test.prepare();
                test.StartMonitors();
                test.Run2("async");
            }
        }
Exemple #2
0
        public YCSBAsyncBenchmarkTest(
            int recordCount,
            int executorCount,
            int txCountPerExecutor,
            VersionDb versionDb,
            string[] flushTables       = null,
            BenchmarkTestConfig config = null)
        {
            this.versionDb          = versionDb;
            this.recordCount        = recordCount;
            this.executorCount      = executorCount;
            this.txCountPerExecutor = txCountPerExecutor;
            this.executorList       = new List <TransactionExecutor>();
            this.totalTasks         = 0;
            this.tables             = flushTables;

            if (config == null)
            {
                config = new BenchmarkTestConfig();
            }
            this.config = config;

            Console.WriteLine("Current Benchmark Test Config: {0}", this.config.ToString());
            Console.WriteLine("Wait for 5 seconds to confirm");
            Console.Out.Flush();
            //Thread.Sleep(5000);
        }
Exemple #3
0
        static void YCSBAsyncTestWithRedisVersionDb(string[] args)
        {
            BenchmarkTestConfig config = args.Length > 1 ? new BenchmarkTestConfig(args) : new BenchmarkTestConfig();

            int partitionCount     = config.WorkerCount;
            int executorCount      = partitionCount;
            int txCountPerExecutor = config.WorkloadCount;
            int recordCount        = config.RecordCount;

            string[] tables =
            {
                YCSBAsyncBenchmarkTest.TABLE_ID,
                VersionDb.TX_TABLE
            };

            string[] readWriteHosts = new string[]
            {
                // config.RedisHost,
                // "8r285aybUZ7+rQ3QgpoorfFodT6+NMDQsxkdfOHAL9w=@txservice.redis.cache.windows.net:6379",
                // "xnke5SdHz5xcsBF+OlZPL7PdzI7Vz3De7ntGI2fIye0=@elastas.redis.cache.windows.net:6379",
                "127.0.0.1:6379",
                //"127.0.0.1:6380",
                //"127.0.0.1:6381",
                //"127.0.0.1:6382",
                //"127.0.0.1:6383",
                //"127.0.0.1:6384",
                //"127.0.0.1:6385",
                //"127.0.0.1:6386",
                //"127.0.0.1:6387",
                //"127.0.0.1:6388",
                //"127.0.0.1:6389",
                //"127.0.0.1:6390",
                //"127.0.0.1:6391",


                //"10.1.9.8:6380",
                //"10.1.9.9:6380",
                //"10.1.9.10:6380",
                //"10.1.9.7:6380",
                //"10.1.9.8:6381",
                //"10.1.9.9:6381",
                //"10.1.9.10:6381",
                //"10.1.9.7:6381",
            };

            RedisVersionDb.PARTITIONS_PER_INSTANCE = config.WorkerPerRedisInstance;
            RedisVersionDb versionDb = RedisVersionDb.Instance(partitionCount, readWriteHosts, RedisVersionDbMode.Partition);

            if (config.MultiProcessMode)
            {
                versionDb.PhysicalTxPartitionByKey = key =>
                {
                    int range = TxRange.GetRange(key);
                    return(range - range / YCSBAsyncBenchmarkTest.RANGE_OFFSET_PER_PROCESS *
                           YCSBAsyncBenchmarkTest.RANGE_OFFSET_PER_PROCESS);
                };
            }

            YCSBAsyncBenchmarkTest test = new YCSBAsyncBenchmarkTest(recordCount,
                                                                     executorCount, txCountPerExecutor, versionDb, tables, config);

            test.Setup(null, null);
            test.Run();
            test.Stats();
        }