示例#1
0
        /// <exception cref="System.Exception" />
        public virtual void Perf()
        {
            TestProvider provider;

            provider = new InsertLongSQLGen();
            provider = new InsertLongSQLGenShort();
            provider = new SelectShort();
            provider = new InsertLong();
            provider = new SelectLongIn();
            provider = new ShardingMultiTableSpace();
            provider = new ShardingDefaultSpace();
            provider = new ShardingTableSpace();
            var schema = GetSchema();
            var sql    = provider.GetSql();

            Console.Out.WriteLine(ServerRouter.Route(schema, sql, null, null));
            var start = Runtime.CurrentTimeMillis();

            provider.Route(schema, 1, sql);
            long end;
            var  loop = 200 * 10000;

            start = Runtime.CurrentTimeMillis();
            provider.Route(schema, loop, sql);
            end = Runtime.CurrentTimeMillis();
            Console.Out.WriteLine((end - start) * 1000.0d / loop + " us");
        }
 /// <exception cref="System.Exception" />
 public static void Main(string[] args)
 {
     var test = new ShardingMultiTableSpace();
     Runtime.CurrentTimeMillis();
     var start = Runtime.CurrentTimeMillis();
     test.TestTableSpace();
     var end = Runtime.CurrentTimeMillis();
     Console.Out.WriteLine("take " + (end - start) + " ms.");
 }
示例#3
0
        /// <exception cref="System.Exception" />
        public static void Main(string[] args)
        {
            var test = new ShardingMultiTableSpace();

            Runtime.CurrentTimeMillis();
            var start = Runtime.CurrentTimeMillis();

            test.TestTableSpace();
            var end = Runtime.CurrentTimeMillis();

            Console.Out.WriteLine("take " + (end - start) + " ms.");
        }
 /// <exception cref="System.Exception" />
 public virtual void Perf()
 {
     TestProvider provider;
     provider = new InsertLongSQLGen();
     provider = new InsertLongSQLGenShort();
     provider = new SelectShort();
     provider = new InsertLong();
     provider = new SelectLongIn();
     provider = new ShardingMultiTableSpace();
     provider = new ShardingDefaultSpace();
     provider = new ShardingTableSpace();
     var schema = GetSchema();
     var sql = provider.GetSql();
     Console.Out.WriteLine(ServerRouter.Route(schema, sql, null, null));
     var start = Runtime.CurrentTimeMillis();
     provider.Route(schema, 1, sql);
     long end;
     var loop = 200*10000;
     start = Runtime.CurrentTimeMillis();
     provider.Route(schema, loop, sql);
     end = Runtime.CurrentTimeMillis();
     Console.Out.WriteLine((end - start)*1000.0d/loop + " us");
 }