couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r749583 - in /couchdb/trunk: share/www/script/test/stats.js src/couchdb/couch_db.erl src/couchdb/couch_file.erl src/couchdb/couch_stats_aggregator.erl
Date Tue, 03 Mar 2009 11:33:15 GMT
Author: jan
Date: Tue Mar  3 11:33:14 2009
New Revision: 749583

URL: http://svn.apache.org/viewvc?rev=749583&view=rev
Log:
stats metrics renamed: os_open_files -> open_os_files, database_changes -> database_writes

Modified:
    couchdb/trunk/share/www/script/test/stats.js
    couchdb/trunk/src/couchdb/couch_db.erl
    couchdb/trunk/src/couchdb/couch_file.erl
    couchdb/trunk/src/couchdb/couch_stats_aggregator.erl

Modified: couchdb/trunk/share/www/script/test/stats.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/stats.js?rev=749583&r1=749582&r2=749583&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/stats.js (original)
+++ couchdb/trunk/share/www/script/test/stats.js Tue Mar  3 11:33:14 2009
@@ -56,21 +56,21 @@
           value: max.toString()}],
 
         function () {
-          var files_open = requestStatsTest("couchdb", "os_files_open").current;
+          var files_open = requestStatsTest("couchdb", "open_os_files").current;
           for(var i=0; i<max+1; i++) {
             var db = new CouchDB("test_suite_db" + i);
             db.deleteDb();
             db.createDb();
           }
 
-          var open_databases = requestStatsTest("couchdb", "open_databases").max;
-          T(max >= open_databases, name);
+          var open_databases = requestStatsTest("couchdb", "open_os_files").max;
+          T(open_databases > 0 && max >= open_databases, name);
 
           for(var i=0; i<max+1; i++) {
             var db = new CouchDB("test_suite_db" + i);
             db.deleteDb();
           }
-          T(files_open == requestStatsTest("couchdb", "os_files_open").current);
+          T(files_open == requestStatsTest("couchdb", "open_os_files").current);
         })
     },
  };
@@ -214,9 +214,9 @@
      db.deleteDb();
      db.createDb();
 
-     var creates = requestStatsTest("couchdb", "database_changes").current;
+     var creates = requestStatsTest("couchdb", "database_writes").current;
      db.save({"a":"1"});
-     var new_creates = requestStatsTest("couchdb", "database_changes").current;
+     var new_creates = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(creates + 1, new_creates, name);
    },
@@ -228,9 +228,9 @@
      var doc = {"_id":"test"};
      db.save(doc);
      
-     var updates = requestStatsTest("couchdb", "database_changes").current;
+     var updates = requestStatsTest("couchdb", "database_writes").current;
      db.save(doc);
-     var new_updates = requestStatsTest("couchdb", "database_changes").current;
+     var new_updates = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(updates + 1, new_updates, name);
    },
@@ -242,9 +242,9 @@
      var doc = {"_id":"test"};
      db.save(doc);
      
-     var deletes = requestStatsTest("couchdb", "database_changes").current;
+     var deletes = requestStatsTest("couchdb", "database_writes").current;
      db.deleteDoc(doc);
-     var new_deletes = requestStatsTest("couchdb", "database_changes").current;
+     var new_deletes = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(deletes + 1, new_deletes, name);
    },
@@ -256,11 +256,11 @@
      var doc = {"_id":"test"};
      db.save(doc);
 
-     var copies = requestStatsTest("couchdb", "database_changes").current;
+     var copies = requestStatsTest("couchdb", "database_writes").current;
      CouchDB.request("COPY", "/test_suite_db/test", {
        headers: {"Destination":"copy_of_test"}
      });
-     var new_copies = requestStatsTest("couchdb", "database_changes").current;
+     var new_copies = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(copies + 1, new_copies, name);
    },
@@ -272,11 +272,11 @@
      var doc = {"_id":"test"};
      db.save(doc);
 
-     var moves = requestStatsTest("couchdb", "database_changes").current;
+     var moves = requestStatsTest("couchdb", "database_writes").current;
      CouchDB.request("MOVE", "/test_suite_db/test?rev=" + doc._rev, {
        headers: {"Destination":"move_of_test"}
      });
-     var new_moves = requestStatsTest("couchdb", "database_changes").current;
+     var new_moves = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(moves + 1, new_moves, name);
    },
@@ -299,9 +299,9 @@
      db.deleteDb();
      db.createDb();
 
-     var creates = requestStatsTest("couchdb", "database_changes").current;
+     var creates = requestStatsTest("couchdb", "database_writes").current;
      CouchDB.request("POST", "/test_suite_db", {body:'{"a":"1"}'});
-     var new_creates = requestStatsTest("couchdb", "database_changes").current;
+     var new_creates = requestStatsTest("couchdb", "database_writes").current;
 
      TEquals(creates + 1, new_creates, name);
    },
@@ -310,12 +310,12 @@
      db.deleteDb();
      db.createDb();
 
-     var creates = requestStatsTest("couchdb", "database_changes").current;
+     var creates = requestStatsTest("couchdb", "database_writes").current;
      CouchDB.request("PUT", "/test_suite_db/bin_doc2/foo2.txt", {
            body:"This is no base64 encoded text",
            headers:{"Content-Type": "text/plain;charset=utf-8"}
      });
-     var new_creates = requestStatsTest("couchdb", "database_changes").current;
+     var new_creates = requestStatsTest("couchdb", "database_writes").current;
      TEquals(creates + 1, new_creates, name);
    },
    'should increment database changes counter when adding attachment to existing doc': function(name)
{
@@ -326,12 +326,12 @@
      var doc = {_id:"test"};
      db.save(doc);
 
-     var updates = requestStatsTest("couchdb", "database_changes").current;
+     var updates = requestStatsTest("couchdb", "database_writes").current;
      CouchDB.request("PUT", "/test_suite_db/test/foo2.txt?rev=" + doc._rev, {
            body:"This is no base64 encoded text",
            headers:{"Content-Type": "text/plain;charset=utf-8"}
      });
-     var new_updates = requestStatsTest("couchdb", "database_changes").current;
+     var new_updates = requestStatsTest("couchdb", "database_writes").current;
      TEquals(updates + 1, new_updates, name);
    }
 

Modified: couchdb/trunk/src/couchdb/couch_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db.erl?rev=749583&r1=749582&r2=749583&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db.erl Tue Mar  3 11:33:14 2009
@@ -286,7 +286,7 @@
     update_docs(#db{update_pid=UpdatePid}=Db, Docs, Options, true).
 
 update_docs(Db, Docs, Options, false) ->
-    couch_stats_collector:increment({couchdb, database_changes}),
+    couch_stats_collector:increment({couchdb, database_writes}),
     DocBuckets = group_alike_docs(Docs),
     Ids = [Id || [#doc{id=Id}|_] <- DocBuckets],
     
@@ -323,7 +323,7 @@
     write_and_commit(Db, DocBuckets2, Options);
     
 update_docs(Db, Docs, Options, true) ->
-    couch_stats_collector:increment({couchdb, database_changes}),
+    couch_stats_collector:increment({couchdb, database_writes}),
 
     % go ahead and generate the new revision ids for the documents.
     Docs2 = lists:map(

Modified: couchdb/trunk/src/couchdb/couch_file.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_file.erl?rev=749583&r1=749582&r2=749583&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_file.erl (original)
+++ couchdb/trunk/src/couchdb/couch_file.erl Tue Mar  3 11:33:14 2009
@@ -285,14 +285,14 @@
                 true ->
                     {ok, 0} = file:position(Fd, 0),
                     ok = file:truncate(Fd),
-                    couch_stats_collector:increment({couchdb, os_files_open}),
+                    couch_stats_collector:increment({couchdb, open_os_files}),
                     {ok, Fd};
                 false ->
                     ok = file:close(Fd),
                     init_status_error(ReturnPid, Ref, file_exists)
                 end;
             false ->
-                couch_stats_collector:increment({couchdb, os_files_open}),
+                couch_stats_collector:increment({couchdb, open_os_files}),
                 {ok, Fd}
             end;
         Error ->
@@ -304,7 +304,7 @@
         {ok, Fd_Read} ->
             {ok, Fd} = file:open(Filepath, [read, write, raw, binary]),
             ok = file:close(Fd_Read),
-            couch_stats_collector:increment({couchdb, os_files_open}),
+            couch_stats_collector:increment({couchdb, open_os_files}),
             {ok, Fd};
         Error ->
             init_status_error(ReturnPid, Ref, Error)
@@ -313,7 +313,7 @@
 
 
 terminate(_Reason, _Fd) ->
-    couch_stats_collector:decrement({couchdb, os_files_open}),
+    couch_stats_collector:decrement({couchdb, open_os_files}),
     ok.
 
 

Modified: couchdb/trunk/src/couchdb/couch_stats_aggregator.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_stats_aggregator.erl?rev=749583&r1=749582&r2=749583&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_stats_aggregator.erl (original)
+++ couchdb/trunk/src/couchdb/couch_stats_aggregator.erl Tue Mar  3 11:33:14 2009
@@ -299,10 +299,10 @@
     % a trailing full-stop / period.
     
     % please keep this in alphabetical order
-    ets:insert(?MODULE, {{couchdb, database_changes}, <<"number of times a database
was changed">>}),
+    ets:insert(?MODULE, {{couchdb, database_writes}, <<"number of times a database
was changed">>}),
     ets:insert(?MODULE, {{couchdb, database_reads}, <<"number of times a document was
read from a database">>}),
     ets:insert(?MODULE, {{couchdb, open_databases}, <<"number of open databases">>}),
-    ets:insert(?MODULE, {{couchdb, os_files_open}, <<"number of file descriptors CouchDB
has open">>}),
+    ets:insert(?MODULE, {{couchdb, open_os_files}, <<"number of file descriptors CouchDB
has open">>}),
     ets:insert(?MODULE, {{couchdb, request_time}, <<"length of a request inside CouchDB
without MochiWeb">>}),
     
     ets:insert(?MODULE, {{httpd, bulk_requests}, <<"number of bulk requests">>}),



Mime
View raw message