Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length < 2)
                {
                    Console.WriteLine("Usage: stressmongo_read [server] [database]");
                    return;
                }

                var connectionString = "mongodb://" + args[0];
                var databaseName     = args[1];
                var client           = new MongoClient(connectionString);
                var mongoServer      = client.GetServer();
                var mongoDb          = mongoServer.GetDatabase(databaseName);

                var mongoread = new ReadThradObj(mongoDb);
                mongoread.StartMongoReadThread();
                Console.WriteLine("Reading thread is now running");

                Console.WriteLine("Press any key to stop reading thread ...");
                Console.ReadKey();
                mongoread.StopMongoReadThread();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length < 2)
                {
                    Console.WriteLine("Usage: stressmongo_read [server] [database]");
                    return;
                }

                var connectionString = "mongodb://" + args[0];
                var databaseName = args[1];
                var client = new MongoClient(connectionString);
                var mongoServer = client.GetServer();
                var mongoDb = mongoServer.GetDatabase(databaseName);

                var mongoread = new ReadThradObj(mongoDb);
                mongoread.StartMongoReadThread();
                Console.WriteLine("Reading thread is now running");

                Console.WriteLine("Press any key to stop reading thread ...");
                Console.ReadKey();
                mongoread.StopMongoReadThread();

            }
            catch (Exception e)
            {
                throw e;
            }
        }