diff options
author | Jan Lehnardt <jan@apache.org> | 2020-01-05 11:32:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-05 11:32:27 +0100 |
commit | 5ef18802cb82169843bd32edee838d4302d0dd97 (patch) | |
tree | d0f062e64882bc3bc5b0dba988302289635058c1 | |
parent | 43fff603bcc29f5d4138e15b764fa83cc871ce92 (diff) | |
download | couchdb-5ef18802cb82169843bd32edee838d4302d0dd97.tar.gz |
feat: add metric counter for unindexed mango queries. Closes #1913 (#2390)
-rw-r--r-- | src/couch/priv/stats_descriptions.cfg | 4 | ||||
-rw-r--r-- | src/mango/src/mango_cursor.erl | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/couch/priv/stats_descriptions.cfg b/src/couch/priv/stats_descriptions.cfg index 0e2271350..ae203bb21 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 c6f21ddf8..dc2ee74c7 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. |