Esempio n. 1
0
        // Main entry
        static void Main(string[] args)
        {
            PrintHelp(args);

            TDengineTest tester = new TDengineTest();

            tester.ReadArgument(args);

            tester.InitTDengine();
            tester.ConnectTDengine();

            if (tester.isInsertOnly == false)
            {
                tester.dropDatabase();
                tester.CreateDb();


                if (tester.useStable == true)
                {
                    tester.CreateStable();
                }

                tester.CreateTablesByThreads();
            }

            Stopwatch watch = Stopwatch.StartNew();

            tester.InsertByThreads();
            watch.Stop();
            double elapsedMs = watch.Elapsed.TotalMilliseconds;

            Console.WriteLine("C# taosdemo: Spent {0} seconds to insert {1} records with {2} record(s) per request: {3} records/second",
                              elapsedMs / 1000,
                              tester.recordsPerTable * tester.numOfTables,
                              tester.batchRows,
                              (tester.recordsPerTable * tester.numOfTables * 1000) / elapsedMs);

            tester.DebugPrintFormat("query command:{0}\n", tester.query);
            if (tester.query != "NONE")
            {
                watch = Stopwatch.StartNew();
                tester.ExecuteQuery();
                watch.Stop();
                elapsedMs = watch.Elapsed.TotalMilliseconds;
                Console.WriteLine("C# taosdemo: Spent {0} seconds to query {1} records.\n",
                                  elapsedMs / 1000,
                                  tester.recordsPerTable * tester.numOfTables
                                  );
            }
            tester.CloseConnection();

            Console.WriteLine("End.");
            CleanAndExitProgram(0);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            TDengineTest tester = new TDengineTest();

            tester.ReadArgument(args);

            Console.WriteLine("---------------------------------------------------------------");
            Console.WriteLine("Starting Testing...");
            Console.WriteLine("---------------------------------------------------------------");

            tester.InitTDengine();
            tester.ConnectTDengine();
            tester.CreateDbAndTable();
            tester.ExecuteInsert();
            tester.ExecuteQuery();
            tester.CloseConnection();

            Console.WriteLine("---------------------------------------------------------------");
            Console.WriteLine("Stop Testing...");
            Console.WriteLine("---------------------------------------------------------------");
        }