couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couchdb commit: updated refs/heads/master to 4ad8de2
Date Fri, 29 Aug 2014 12:51:16 GMT
Repository: couchdb
Updated Branches:
  refs/heads/master 13fa1e3fa -> 4ad8de2ba


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/master
Commit: 4ad8de2baefa471c3beb0cacfc67569deb1bad99
Parents: 13fa1e3
Author: Robert Newson <rnewson@apache.org>
Authored: Fri Aug 29 13:51:03 2014 +0100
Committer: Robert Newson <rnewson@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.");
     };


Mime
View raw message