From 2df3fabfdc2039504295219c88e0d160f76c1afb Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 16 Oct 2009 21:38:11 +0000 Subject: added bench/ directory to trunk, contains 2 benchmark suites. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@826097 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 86465c95..bac3881c 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -436,7 +436,8 @@ CouchDB.requestStats = function(module, key, test) { CouchDB.uuids_cache = []; -CouchDB.newUuids = function(n) { +CouchDB.newUuids = function(n, buf) { + buf = buf || 100; if (CouchDB.uuids_cache.length >= n) { var uuids = CouchDB.uuids_cache.slice(CouchDB.uuids_cache.length - n); if(CouchDB.uuids_cache.length - n == 0) { @@ -447,12 +448,12 @@ CouchDB.newUuids = function(n) { } return uuids; } else { - CouchDB.last_req = CouchDB.request("GET", "/_uuids?count=" + (100 + n)); + CouchDB.last_req = CouchDB.request("GET", "/_uuids?count=" + (buf + n)); CouchDB.maybeThrowError(CouchDB.last_req); var result = JSON.parse(CouchDB.last_req.responseText); CouchDB.uuids_cache = - CouchDB.uuids_cache.concat(result.uuids.slice(0, 100)); - return result.uuids.slice(100); + CouchDB.uuids_cache.concat(result.uuids.slice(0, buf)); + return result.uuids.slice(buf); } } -- cgit v1.2.3