You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2025/03/11 21:04:41 UTC

(couchdb) branch nouveau-connection-closed-counter created (now e9dfa7264)

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

rnewson pushed a change to branch nouveau-connection-closed-counter
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at e9dfa7264 nouveau: add a metric for connection_closed errors

This branch includes the following new commits:

     new e9dfa7264 nouveau: add a metric for connection_closed errors

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(couchdb) 01/01: nouveau: add a metric for connection_closed errors

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch nouveau-connection-closed-counter
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit e9dfa72642e2c8220e184d2e8e3c39db2cd47e95
Author: Robert Newson <rn...@apache.org>
AuthorDate: Tue Mar 11 21:04:20 2025 +0000

    nouveau: add a metric for connection_closed errors
---
 src/nouveau/priv/stats_descriptions.cfg | 5 +++++
 src/nouveau/src/nouveau_api.erl         | 1 +
 2 files changed, 6 insertions(+)

diff --git a/src/nouveau/priv/stats_descriptions.cfg b/src/nouveau/priv/stats_descriptions.cfg
index 1981e9aa9..3985ba806 100644
--- a/src/nouveau/priv/stats_descriptions.cfg
+++ b/src/nouveau/priv/stats_descriptions.cfg
@@ -24,3 +24,8 @@
     {type, histogram},
     {desc, <<"Distribution of time during search waiting for the index to be updated">>}
 ]}.
+
+{[nouveau, connection_closed_errors], [
+    {type, counter},
+    {desc, <<"number of times we've retried a request after a connection_closed response">>}
+]}.
diff --git a/src/nouveau/src/nouveau_api.erl b/src/nouveau/src/nouveau_api.erl
index e17f82ee9..27b1fd349 100644
--- a/src/nouveau/src/nouveau_api.erl
+++ b/src/nouveau/src/nouveau_api.erl
@@ -344,6 +344,7 @@ retry_if_connection_closes(_Fun, 0) ->
 retry_if_connection_closes(Fun, N) when is_integer(N), N > 0 ->
     case Fun() of
         {error, connection_closed} ->
+            couch_stats:increment_counter([nouveau, connection_closed_errors]),
             timer:sleep(1000),
             retry_if_connection_closes(Fun, N - 1);
         Else ->