You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2014/08/29 22:46:06 UTC

[06/13] couchdb commit: updated refs/heads/1963-eunit-bigcouch to 36bd96a

Update tests for new _stats API


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/4ad8de2b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/4ad8de2b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/4ad8de2b

Branch: refs/heads/1963-eunit-bigcouch
Commit: 4ad8de2baefa471c3beb0cacfc67569deb1bad99
Parents: 13fa1e3
Author: Robert Newson <rn...@apache.org>
Authored: Fri Aug 29 13:51:03 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Aug 29 13:51:03 2014 +0100

----------------------------------------------------------------------
 share/www/script/test/auth_cache.js |  6 +++---
 share/www/script/test/stats.js      | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4ad8de2b/share/www/script/test/auth_cache.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/auth_cache.js b/share/www/script/test/auth_cache.js
index 17cb70f..39b9887 100644
--- a/share/www/script/test/auth_cache.js
+++ b/share/www/script/test/auth_cache.js
@@ -52,13 +52,13 @@ couchTests.auth_cache = function(debug) {
 
   function hits() {
     var hits = CouchDB.requestStats(["couchdb", "auth_cache_hits"], true);
-    return hits.current || 0;
+    return hits.value || 0;
   }
 
 
   function misses() {
     var misses = CouchDB.requestStats(["couchdb", "auth_cache_misses"], true);
-    return misses.current || 0;
+    return misses.value || 0;
   }
 
 
@@ -266,4 +266,4 @@ couchTests.auth_cache = function(debug) {
 
   // cleanup
   authDb.deleteDb();
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4ad8de2b/share/www/script/test/stats.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/stats.js b/share/www/script/test/stats.js
index 6fb0fbb..afc2ef5 100644
--- a/share/www/script/test/stats.js
+++ b/share/www/script/test/stats.js
@@ -22,7 +22,7 @@ couchTests.stats = function(debug) {
   };
 
   function getStat(mod, key) {
-    return CouchDB.requestStats(mod, key, true);
+    return CouchDB.requestStats([mod, key], true);
   };
 
   function doView(db) {
@@ -40,9 +40,9 @@ couchTests.stats = function(debug) {
   function runTest(mod, key, funcs) {
     var db = newDb("test_suite_db", true);
     if(funcs.setup) funcs.setup(db);
-    var before = getStat(mod, key).current;
+    var before = getStat(mod, key).value;
     if(funcs.run) funcs.run(db);
-    var after = getStat(mod, key).current;
+    var after = getStat(mod, key).value;
     if(funcs.test) funcs.test(before, after);
   }
 
@@ -52,9 +52,9 @@ couchTests.stats = function(debug) {
     var db = newDb("test_suite_db");
     db.deleteDb();
   
-    var before = getStat("couchdb", "open_databases").current;
+    var before = getStat("couchdb", "open_databases").value;
     db.createDb();
-    var after = getStat("couchdb", "open_databases").current;
+    var after = getStat("couchdb", "open_databases").value;
     TEquals(before+1, after, "Creating a db increments open db count.");
   })();
   
@@ -78,8 +78,8 @@ couchTests.stats = function(debug) {
     var max = 5;
     
     var testFun = function() {
-      var pre_dbs = getStat("couchdb", "open_databases").current || 0;
-      var pre_files = getStat("couchdb", "open_os_files").current || 0;
+      var pre_dbs = getStat("couchdb", "open_databases").value || 0;
+      var pre_files = getStat("couchdb", "open_os_files").value || 0;
      
       var triggered = false;
       var db = null;
@@ -99,7 +99,7 @@ couchTests.stats = function(debug) {
       }
       T(triggered, "We managed to force a all_dbs_active error.");
       
-      var open_dbs = getStat("couchdb", "open_databases").current;
+      var open_dbs = getStat("couchdb", "open_databases").value;
       TEquals(open_dbs > 0, true, "We actually opened some dbs.");
       TEquals(open_dbs, max, "We only have max db's open.");
       
@@ -107,8 +107,8 @@ couchTests.stats = function(debug) {
         newDb("test_suite_db_" + i).deleteDb();
       }
       
-      var post_dbs = getStat("couchdb", "open_databases").current;
-      var post_files = getStat("couchdb", "open_os_files").current;
+      var post_dbs = getStat("couchdb", "open_databases").value;
+      var post_files = getStat("couchdb", "open_os_files").value;
       TEquals(pre_dbs, post_dbs, "We have the same number of open dbs.");
       TEquals(pre_files, post_files, "We have the same number of open files.");
     };