summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-07-13 11:24:43 -0400
committerEliot Horowitz <eliot@10gen.com>2009-07-13 11:24:43 -0400
commit86c5028dca3c2fee85ff26d0ed595e623d3f9ad2 (patch)
treed359556a71a96feb2880cfc10e753390a2f457e2 /tools
parentfedd299a87675a4dc29f5458b953940bef9ff8f6 (diff)
downloadmongo-86c5028dca3c2fee85ff26d0ed595e623d3f9ad2.tar.gz
fix 64-bit mongorestore
Diffstat (limited to 'tools')
-rw-r--r--tools/restore.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/restore.cpp b/tools/restore.cpp
index fc202c14d5a..1efadfaf41d 100644
--- a/tools/restore.cpp
+++ b/tools/restore.cpp
@@ -91,10 +91,11 @@ public:
assert( mmf.map( root.string().c_str() , fileLength ) );
char * data = (char*)mmf.viewOfs();
- int read = 0;
+ long read = 0;
- int num = 0;
+ long num = 0;
+ int msgDelay = 1000 * ( mmf.length() / ( 1024 * 1024 * 400 ) );
while ( read < mmf.length() ) {
BSONObj o( data );
@@ -103,8 +104,8 @@ public:
read += o.objsize();
data += o.objsize();
- if ( ! ( ++num % 1000 ) )
- out() << "read " << read << "/" << mmf.length() << " bytes so far. " << num << " objects" << endl;
+ if ( ! ( ++num % msgDelay ) )
+ out() << "read " << read << "/" << mmf.length() << " bytes so far. (" << (int)(read * 100 / mmf.length()) << "%) " << num << " objects" << endl;
}
out() << "\t " << num << " objects" << endl;