diff options
author | Jan Lehnardt <jan@apache.org> | 2009-03-03 11:33:14 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-03-03 11:33:14 +0000 |
commit | 745ec3bec56e8c66bf0e4c862b02f925052a339c (patch) | |
tree | 0b11bcb067ed6443465bdb20ccb9d9b9768edfa6 | |
parent | f5ebfabcf1807f5164a2094524e7769d2390dc0b (diff) |
stats metrics renamed: os_open_files -> open_os_files, database_changes -> database_writes
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@749583 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | share/www/script/test/stats.js | 40 | ||||
-rw-r--r-- | src/couchdb/couch_db.erl | 4 | ||||
-rw-r--r-- | src/couchdb/couch_file.erl | 8 | ||||
-rw-r--r-- | src/couchdb/couch_stats_aggregator.erl | 4 |
4 files changed, 28 insertions, 28 deletions
diff --git a/share/www/script/test/stats.js b/share/www/script/test/stats.js index 204fe302..9fb643b2 100644 --- a/share/www/script/test/stats.js +++ b/share/www/script/test/stats.js @@ -56,21 +56,21 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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 @@ couchTests.stats = function(debug) { 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); } diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index 963c834b..92026ff1 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -286,7 +286,7 @@ update_docs(#db{update_pid=UpdatePid}=Db, Docs, Options) -> 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 @@ update_docs(Db, Docs, Options, false) -> 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( diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl index 364eafd6..4db55e70 100644 --- a/src/couchdb/couch_file.erl +++ b/src/couchdb/couch_file.erl @@ -285,14 +285,14 @@ init({Filepath, Options, ReturnPid, Ref}) -> 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 @@ init({Filepath, Options, ReturnPid, Ref}) -> {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 @@ init({Filepath, Options, ReturnPid, Ref}) -> terminate(_Reason, _Fd) -> - couch_stats_collector:decrement({couchdb, os_files_open}), + couch_stats_collector:decrement({couchdb, open_os_files}), ok. diff --git a/src/couchdb/couch_stats_aggregator.erl b/src/couchdb/couch_stats_aggregator.erl index 063f4791..bc37ab96 100644 --- a/src/couchdb/couch_stats_aggregator.erl +++ b/src/couchdb/couch_stats_aggregator.erl @@ -299,10 +299,10 @@ init_descriptions() -> % 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">>}), |