diff options
author | Jan Lehnardt <jan@apache.org> | 2009-02-26 17:28:25 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-02-26 17:28:25 +0000 |
commit | 3eb02e96bc134806a7b432b4002708af90432d33 (patch) | |
tree | 79f57c7505cc56a252adbc31732070f010ade4aa /src/couchdb/couch_db.erl | |
parent | 8a5b0c697a6fdb3169afe82391368c26bec86978 (diff) |
- 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
Diffstat (limited to 'src/couchdb/couch_db.erl')
-rw-r--r-- | src/couchdb/couch_db.erl | 7 |
1 files changed, 6 insertions, 1 deletions
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 |