Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

testlatency.js

  • Loading branch information...
commit f75be93e6f03ada079642ee01439aaed8935b20e 1 parent 1a59585
Dwight Merriman dwight authored
15 replication/test_latency.js
View
@@ -11,7 +11,10 @@
*/
slave = db;
-assert(!slave.runCommand("ismaster").ismaster);
+if (slave.runCommand("ismaster").ismaster) {
+ print("db from command line should be the slave -- and it isn't -- see comments in this .js file. exiting");
+ quit();
+}
print("slave ok");
master = new Mongo("localhost").getDB("test");
@@ -43,7 +46,7 @@ function latencytest() {
slaveobj = t.findOne();
if (slaveobj && slaveobj.y == obj.y)
break;
- sleep(2); // wait 2 ms
+ sleep(1);
}
}
@@ -55,8 +58,8 @@ function run() {
}
print();
-print("try running:");
-print(" ptime( function(){T.findOne()} )");
-print(" ptime( function(){t.findOne()} )");
-print(" run()");
+print("try running these:");
+print(" ptime( function(){T.findOne()} ) // should be quick as hits only 1 server");
+print(" ptime( function(){t.findOne()} ) // should be quick");
+print(" run() // takes a little time awaits full replication");
print();
5 replication/tl.bat
View
@@ -0,0 +1,5 @@
+mkdir \data\a
+mkdir \data\b
+start mongod --master --dbpath c:\data\a
+start mongod --slave --dbpath c:\data\b --port 27000 --source localhost
+mongo --shell localhost:27000 test_latency.js
15 vs2010/snippets/snippets.sln
View
@@ -0,0 +1,15 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "replication", "replication", "{96D6995D-DBFC-4EBD-92F5-D9812F9C5B09}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\replication\misc.js = ..\..\replication\misc.js
+ ..\..\replication\test_latency.js = ..\..\replication\test_latency.js
+ ..\..\replication\tl.bat = ..\..\replication\tl.bat
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Please sign in to comment.
Something went wrong with that request. Please try again.