pgj commented on code in PR #4958:
URL: https://github.com/apache/couchdb/pull/4958#discussion_r1462276282


##########
src/mango/src/mango_execution_stats.erl:
##########
@@ -123,19 +123,19 @@ shard_init() ->
     InitialState = #{docs_examined => 0, keys_examined => 0},
     put(?SHARD_STATS_KEY, InitialState).
 
--spec shard_incr_keys_examined() -> any().
-shard_incr_keys_examined() ->
-    incr(keys_examined).
+-spec shard_incr_keys_examined(integer()) -> any().
+shard_incr_keys_examined(N) ->
+    incr(keys_examined, N).
 
--spec shard_incr_docs_examined() -> any().
-shard_incr_docs_examined() ->
-    incr(docs_examined).
+-spec shard_incr_docs_examined(integer()) -> any().
+shard_incr_docs_examined(N) ->
+    incr(docs_examined, N).
 
--spec incr(atom()) -> any().
-incr(Key) ->
+-spec incr(atom(), integer()) -> any().
+incr(Key, N) ->

Review Comment:
   Good idea!  I used this opportunity as well to add a branch for handling 
`incr(Key, 0)` specifically to do nothing since that should cause any change.



-- 
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: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to