Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add tests to notice if paddingfactor were to regress

  • Loading branch information...
commit e9e92021e342d92915f9e5d21cb3757e85ad32e9 1 parent 47e564f
@dwight dwight authored
Showing with 16 additions and 0 deletions.
  1. +3 −0  jstests/insert1.js
  2. +13 −0 jstests/update.js
View
3  jstests/insert1.js
@@ -39,3 +39,6 @@ assert.eq(id1, id2, "ids match 4");
assert.eq(o, {a:4, _id:id1}, "input unchanged 4");
assert.eq(t.findOne({_id:id1}).a, 4, "find by id 4");
assert.eq(t.findOne({a:4})._id, id1 , "find by val 4");
+
+var stats = db.runCommand({ collstats: "insert1" });
+assert(stats.paddingFactor == 1.0);
View
13 jstests/update.js
@@ -23,3 +23,16 @@ for(var i=1; i<=5000; i++) {
}
assert(asdf.validate().valid);
+
+var stats = db.runCommand({ collstats: "asdf" });
+
+// some checks. want to check that padding factor is working; in addition this lets us do a little basic
+// testing of the collstats command at the same time
+assert(stats.count == 5000);
+assert(stats.size < 140433012 * 5 && stats.size > 1000000);
+assert(stats.numExtents < 20);
+assert(stats.nindexes == 1);
+var pf = stats.paddingFactor;
+print("update.js padding factor: " + pf);
+assert(pf > 1.7 && pf < 2);
+
Please sign in to comment.
Something went wrong with that request. Please try again.