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


##########
src/mango/src/mango_cursor_view.erl:
##########
@@ -336,19 +348,66 @@ choose_best_index(IndexRanges) ->
     {SelectedIndex, SelectedIndexRanges, _} = hd(SortedIndexRanges),
     {{SelectedIndex, SelectedIndexRanges}, SortedIndexRanges}.
 
+-spec maybe_init_stats(Options) -> ok when
+    Options :: mrargs_extra().
+maybe_init_stats(Options) ->
+    case couch_util:get_value(execution_stats_rolling, Options, false) of
+        true -> ok;
+        false -> mango_execution_stats:shard_init()
+    end.
+
+-spec roll_stats(Stats, Options) -> ok when
+    Stats :: shard_stats_v2(),
+    Options :: mrargs_extra().
+roll_stats(Stats, Options) ->
+    case couch_util:get_value(execution_stats_rolling, Options, false) of
+        true ->
+            ok = rexi:stream2({execution_stats, format_stats(Stats, Options)});
+        false ->
+            KeysExamined = maps:get(keys_examined, Stats),
+            DocsExamined = maps:get(docs_examined, Stats),

Review Comment:
   Suggestion: instead of maps:get use in-line maps syntax `#{keys_examined := 
KeysExamined, docs_examined := DocsExamined} = Stats`.



-- 
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