rnewson commented on code in PR #4862:
URL: https://github.com/apache/couchdb/pull/4862#discussion_r1399530868
##########
src/couch/src/couch_db.erl:
##########
@@ -297,7 +303,13 @@ open_doc(Db, IdOrDocInfo) ->
open_doc(Db, IdOrDocInfo, []).
open_doc(Db, Id, Options) ->
- increment_stat(Db, [couchdb, database_reads]),
+ open_doc(Db, Id, Options, true).
+
+open_doc(Db, Id, Options, ChangeStat) ->
+ case ChangeStat of
+ true -> ?MODULE:increment_stat(Db, [couchdb, database_reads]);
+ false -> ok
+ end,
Review Comment:
I'd put this setting inside the Options list, however shouldn't
database_reads be incremented whenever we read? open_doc_int/3 will open the
doc, so why wouldn't we count it? It seems the path in question opens the same
doc twice? If so, that's not a double counting error in my view, incrementing
twice seems correct?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]