You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2020/01/05 10:32:38 UTC

[couchdb] branch master updated: feat: add metric counter for unindexed mango queries. Closes #1913 (#2390)

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ef1880  feat: add metric counter for unindexed mango queries. Closes #1913 (#2390)
5ef1880 is described below

commit 5ef18802cb82169843bd32edee838d4302d0dd97
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sun Jan 5 11:32:27 2020 +0100

    feat: add metric counter for unindexed mango queries. Closes #1913 (#2390)
---
 src/couch/priv/stats_descriptions.cfg | 4 ++++
 src/mango/src/mango_cursor.erl        | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/couch/priv/stats_descriptions.cfg b/src/couch/priv/stats_descriptions.cfg
index 0e22713..ae203bb 100644
--- a/src/couch/priv/stats_descriptions.cfg
+++ b/src/couch/priv/stats_descriptions.cfg
@@ -298,3 +298,7 @@
     {type, counter},
     {desc, <<"number of the attempts to read beyond set limit">>}
 ]}.
+{[mango, unindexed_queries], [
+    {type, counter},
+    {desc, <<"number of mango queries that could not use an index">>}
+]}.
diff --git a/src/mango/src/mango_cursor.erl b/src/mango/src/mango_cursor.erl
index c6f21dd..dc2ee74 100644
--- a/src/mango/src/mango_cursor.erl
+++ b/src/mango/src/mango_cursor.erl
@@ -182,6 +182,7 @@ maybe_add_warning_int(ok, _, UserAcc) ->
    UserAcc;
 
 maybe_add_warning_int(Warning, UserFun, UserAcc) ->
+    couch_stats:increment_counter([mango, unindexed_queries]),
     Arg = {add_key, warning, Warning},
     {_Go, UserAcc0} = UserFun(Arg, UserAcc),
     UserAcc0.