From 3eb02e96bc134806a7b432b4002708af90432d33 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Thu, 26 Feb 2009 17:28:25 +0000 Subject: - add descriptions to metrics - move document_* metrics to couch_db module and merge them into database_* metrics git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@748217 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_db.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/couchdb/couch_db.erl') diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index d9caa36f..963c834b 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -92,6 +92,7 @@ open_doc(Db, IdOrDocInfo) -> open_doc(Db, IdOrDocInfo, []). open_doc(Db, Id, Options) -> + couch_stats_collector:increment({couchdb, database_reads}), case open_doc_int(Db, Id, Options) of {ok, #doc{deleted=true}=Doc} -> case lists:member(deleted, Options) of @@ -105,6 +106,7 @@ open_doc(Db, Id, Options) -> end. open_doc_revs(Db, Id, Revs, Options) -> + couch_stats_collector:increment({couchdb, database_reads}), [Result] = open_doc_revs_int(Db, [{Id, Revs}], Options), Result. @@ -284,6 +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}), DocBuckets = group_alike_docs(Docs), Ids = [Id || [#doc{id=Id}|_] <- DocBuckets], @@ -320,7 +323,9 @@ update_docs(Db, Docs, Options, false) -> write_and_commit(Db, DocBuckets2, Options); update_docs(Db, Docs, Options, true) -> - % go ahead and generate the new revision ids for the documents. + couch_stats_collector:increment({couchdb, database_changes}), + + % go ahead and generate the new revision ids for the documents. Docs2 = lists:map( fun(#doc{id=Id,revs=Revs}=Doc) -> case Id of -- cgit v1.2.3