Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 882AC11806 for ; Thu, 21 Aug 2014 07:36:04 +0000 (UTC) Received: (qmail 9428 invoked by uid 500); 21 Aug 2014 07:36:04 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 9372 invoked by uid 500); 21 Aug 2014 07:36:04 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 9362 invoked by uid 99); 21 Aug 2014 07:36:04 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2014 07:36:04 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id EADA69BABA4; Thu, 21 Aug 2014 07:36:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Message-Id: <6ea664aaa13d434eb9b45a97a63518db@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: rexi commit: updated refs/heads/windsor-merge to bbf59a2 Date: Thu, 21 Aug 2014 07:36:03 +0000 (UTC) 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 Authored: Thu Aug 21 01:11:31 2014 -0500 Committer: Paul J. Davis 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) ->