File tree 3 files changed +29
-6
lines changed
3 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 11
11
*/
12
12
13
13
slave = db ;
14
- assert ( ! slave . runCommand ( "ismaster" ) . ismaster ) ;
14
+ if ( slave . runCommand ( "ismaster" ) . ismaster ) {
15
+ print ( "db from command line should be the slave -- and it isn't -- see comments in this .js file. exiting" ) ;
16
+ quit ( ) ;
17
+ }
15
18
print ( "slave ok" ) ;
16
19
17
20
master = new Mongo ( "localhost" ) . getDB ( "test" ) ;
@@ -43,7 +46,7 @@ function latencytest() {
43
46
slaveobj = t . findOne ( ) ;
44
47
if ( slaveobj && slaveobj . y == obj . y )
45
48
break ;
46
- sleep ( 2 ) ; // wait 2 ms
49
+ sleep ( 1 ) ;
47
50
}
48
51
}
49
52
@@ -55,8 +58,8 @@ function run() {
55
58
}
56
59
57
60
print ( ) ;
58
- print ( "try running:" ) ;
59
- print ( " ptime( function(){T.findOne()} )" ) ;
60
- print ( " ptime( function(){t.findOne()} )" ) ;
61
- print ( " run()" ) ;
61
+ print ( "try running these :" ) ;
62
+ print ( " ptime( function(){T.findOne()} ) // should be quick as hits only 1 server " ) ;
63
+ print ( " ptime( function(){t.findOne()} ) // should be quick " ) ;
64
+ print ( " run() // takes a little time awaits full replication " ) ;
62
65
print ( ) ;
Original file line number Diff line number Diff line change
1
+ mkdir \data\a
2
+ mkdir \data\b
3
+ start mongod --master --dbpath c:\data\a
4
+ start mongod --slave --dbpath c:\data\b --port 27000 --source localhost
5
+ mongo --shell localhost:27000 test_latency.js
Original file line number Diff line number Diff line change
1
+
2
+ Microsoft Visual Studio Solution File, Format Version 11.00
3
+ # Visual Studio 2010
4
+ Project ("{2150E333-8FDC-42A3-9474-1A3956D46DE8}" ) = "replication" , "replication" , "{96D6995D-DBFC-4EBD-92F5-D9812F9C5B09}"
5
+ Project Section (SolutionItems ) = preProject
6
+ ..\..\replication \misc .js = ..\..\replication \misc .js
7
+ ..\..\replication \test _latency .js = ..\..\replication \test _latency .js
8
+ ..\..\replication \tl .bat = ..\..\replication \tl .bat
9
+ EndProject Section
10
+ EndProject
11
+ Global
12
+ GlobalSection (SolutionProperties ) = preSolution
13
+ HideSolutionNode = FALSE
14
+ EndGlobalSection
15
+ EndGlobal
You can’t perform that action at this time.
0 commit comments