couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject rexi commit: updated refs/heads/windsor-merge to bbf59a2
Date Thu, 21 Aug 2014 07:36:03 GMT
Repository: couchdb-rexi
Updated Branches:
  refs/heads/windsor-merge 6a720a217 -> bbf59a217 (forced update)


Update to use couch_stats


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/commit/bbf59a21
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/tree/bbf59a21
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/diff/bbf59a21

Branch: refs/heads/windsor-merge
Commit: bbf59a2174772c76e26daa5afeeb6f6c038088fb
Parents: a853c32
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Thu Aug 21 01:11:31 2014 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Thu Aug 21 02:35:56 2014 -0500

----------------------------------------------------------------------
 priv/stats_descriptions.cfg | 24 ++++++++++++++++++++++++
 src/rexi.app.src            |  1 +
 src/rexi.erl                |  6 ++++++
 src/rexi_buffer.erl         |  2 ++
 src/rexi_monitor.erl        |  1 +
 5 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/bbf59a21/priv/stats_descriptions.cfg
----------------------------------------------------------------------
diff --git a/priv/stats_descriptions.cfg b/priv/stats_descriptions.cfg
new file mode 100644
index 0000000..93c29d9
--- /dev/null
+++ b/priv/stats_descriptions.cfg
@@ -0,0 +1,24 @@
+{[rexi, buffered], [
+    {type, counter},
+    {desc, <<"number of rexi messages buffered">>}
+]}.
+{[rexi, down], [
+    {type, counter},
+    {desc, <<"number of rexi_DOWN messages handled">>}
+]}.
+{[rexi, dropped], [
+    {type, counter},
+    {desc, <<"number of rexi messages dropped from buffers">>}
+]}.
+{[rexi, streams, timeout, init_stream], [
+    {type, counter},
+    {desc, <<"number of rexi stream initialization timeouts">>}
+]}.
+{[rexi, streams, timeout, stream], [
+    {type, counter},
+    {desc, <<"number of rexi stream timeouts">>}
+]}.
+{[rexi, streams, timeout, wait_for_ack], [
+    {type, counter},
+    {desc, <<"number of rexi stream timeouts while waiting for acks">>}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/bbf59a21/src/rexi.app.src
----------------------------------------------------------------------
diff --git a/src/rexi.app.src b/src/rexi.app.src
index 639e9dc..efe128c 100644
--- a/src/rexi.app.src
+++ b/src/rexi.app.src
@@ -31,6 +31,7 @@
         kernel,
         stdlib,
         couch_log,
+        couch_stats,
         config
     ]},
     {mod, {rexi_app,[]}}

http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/bbf59a21/src/rexi.erl
----------------------------------------------------------------------
diff --git a/src/rexi.erl b/src/rexi.erl
index 69fbd77..fea4d64 100644
--- a/src/rexi.erl
+++ b/src/rexi.erl
@@ -134,6 +134,9 @@ stream_init(Timeout) ->
         rexi_STREAM_CANCEL ->
             exit(normal);
         timeout ->
+            couch_stats:increment_counter(
+                [rexi, streams, timeout, init_stream]
+            ),
             exit(timeout);
         Else ->
             exit({invalid_stream_message, Else})
@@ -179,6 +182,7 @@ stream(Msg, Limit, Timeout) ->
             erlang:send(Caller, {Ref, self(), Msg}),
             ok
     catch throw:timeout ->
+        couch_stats:increment_counter([rexi, streams, timeout, stream]),
         exit(timeout)
     end.
 
@@ -205,6 +209,7 @@ stream2(Msg, Limit, Timeout) ->
             erlang:send(Caller, {Ref, self(), Msg}),
             ok
     catch throw:timeout ->
+        couch_stats:increment_counter([rexi, streams, timeout, stream]),
         exit(timeout)
     end.
 
@@ -267,6 +272,7 @@ wait_for_ack(Count, Timeout) ->
     receive
         {rexi_ack, N} -> drain_acks(Count-N)
     after Timeout ->
+        couch_stats:increment_counter([rexi, streams, timeout, wait_for_ack]),
         throw(timeout)
     end.
 

http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/bbf59a21/src/rexi_buffer.erl
----------------------------------------------------------------------
diff --git a/src/rexi_buffer.erl b/src/rexi_buffer.erl
index 2be2322..d16dc8b 100644
--- a/src/rexi_buffer.erl
+++ b/src/rexi_buffer.erl
@@ -50,9 +50,11 @@ handle_call(get_buffered_count, _From, State) ->
     {reply, State#state.count, State, 0}.
 
 handle_cast({deliver, Dest, Msg}, #state{buffer = Q, count = C} = State) ->
+    couch_stats:increment_counter([rexi, buffered]),
     Q2 = queue:in({Dest, Msg}, Q),
     case should_drop(State) of
     true ->
+        couch_stats:increment_counter([rexi, dropped]),
             {noreply, State#state{buffer = queue:drop(Q2)}, 0};
     false ->
             {noreply, State#state{buffer = Q2, count = C+1}, 0}

http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/bbf59a21/src/rexi_monitor.erl
----------------------------------------------------------------------
diff --git a/src/rexi_monitor.erl b/src/rexi_monitor.erl
index 7be3f0a..f143ead 100644
--- a/src/rexi_monitor.erl
+++ b/src/rexi_monitor.erl
@@ -40,6 +40,7 @@ stop(MonitoringPid) ->
 %% internal functions %%
 
 notify_parent(Parent, Pid, Reason) ->
+    couch_stats:increment_counter([rexi, down]),
     erlang:send(Parent, {rexi_DOWN, self(), Pid, Reason}).
 
 should_monitor(Pid, Nodes) when is_pid(Pid) ->


Mime
View raw message