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 8D6AC11B87 for ; Thu, 28 Aug 2014 12:12:51 +0000 (UTC) Received: (qmail 13684 invoked by uid 500); 28 Aug 2014 12:12:51 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 13638 invoked by uid 500); 28 Aug 2014 12:12:51 -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 13628 invoked by uid 99); 28 Aug 2014 12:12:51 -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, 28 Aug 2014 12:12:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 24AB9A02C51; Thu, 28 Aug 2014 12:12:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 12:12:55 -0000 Message-Id: <00ffeabfddf24b59b320b12e865e8be1@git.apache.org> In-Reply-To: <93ecc4eade71415293123ac9350f8069@git.apache.org> References: <93ecc4eade71415293123ac9350f8069@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/9] couch-mrview commit: updated refs/heads/master to 4cc8114 Update to use couch_stats Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/2c41c9d3 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/2c41c9d3 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/2c41c9d3 Branch: refs/heads/master Commit: 2c41c9d31a287f037fde00181525ddd9570f2634 Parents: ad72dc8 Author: Paul J. Davis Authored: Thu Aug 21 02:04:07 2014 -0500 Committer: Paul J. Davis Committed: Thu Aug 21 02:04:28 2014 -0500 ---------------------------------------------------------------------- src/couch_mrview.app.src | 2 +- src/couch_mrview_http.erl | 9 +++++---- src/couch_mrview_updater.erl | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/2c41c9d3/src/couch_mrview.app.src ---------------------------------------------------------------------- diff --git a/src/couch_mrview.app.src b/src/couch_mrview.app.src index 99c52f0..4da46f9 100644 --- a/src/couch_mrview.app.src +++ b/src/couch_mrview.app.src @@ -24,5 +24,5 @@ couch_mrview_util ]}, {registered, []}, - {applications, [kernel, stdlib, couch_index]} + {applications, [kernel, stdlib, couch_index, couch_stats]} ]}. http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/2c41c9d3/src/couch_mrview_http.erl ---------------------------------------------------------------------- diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl index 4c7355d..4ae72f3 100644 --- a/src/couch_mrview_http.erl +++ b/src/couch_mrview_http.erl @@ -49,7 +49,7 @@ handle_all_docs_req(Req, _Db) -> handle_view_req(#httpd{method='GET'}=Req, Db, DDoc) -> [_, _, _, _, ViewName] = Req#httpd.path_parts, - couch_stats_collector:increment({httpd, view_reads}), + couch_stats:increment_counter([httpd, view_reads]), design_doc_view(Req, Db, DDoc, ViewName, undefined); handle_view_req(#httpd{method='POST'}=Req, Db, DDoc) -> [_, _, _, _, ViewName] = Req#httpd.path_parts, @@ -58,10 +58,11 @@ handle_view_req(#httpd{method='POST'}=Req, Db, DDoc) -> Queries = couch_mrview_util:get_view_queries(Props), case {Queries, Keys} of {Queries, undefined} when is_list(Queries) -> - [couch_stats_collector:increment({httpd, view_reads}) || _I <- Queries], + IncrBy = length(Queries), + couch_stats:increment_counter([couchdb, httpd, view_reads], IncrBy), multi_query_view(Req, Db, DDoc, ViewName, Queries); {undefined, Keys} when is_list(Keys) -> - couch_stats_collector:increment({httpd, view_reads}), + couch_stats:increment_counter([couchdb, httpd, view_reads]), design_doc_view(Req, Db, DDoc, ViewName, Keys); {undefined, undefined} -> throw({ @@ -81,7 +82,7 @@ handle_temp_view_req(#httpd{method='POST'}=Req, Db) -> {Body} = couch_httpd:json_body_obj(Req), DDoc = couch_mrview_util:temp_view_to_ddoc({Body}), Keys = couch_mrview_util:get_view_keys({Body}), - couch_stats_collector:increment({httpd, temporary_view_reads}), + couch_stats:increment_counter([couchdb, httpd, temporary_view_reads]), design_doc_view(Req, Db, DDoc, <<"temp">>, Keys); handle_temp_view_req(Req, _Db) -> couch_httpd:send_method_not_allowed(Req, "POST"). http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/2c41c9d3/src/couch_mrview_updater.erl ---------------------------------------------------------------------- diff --git a/src/couch_mrview_updater.erl b/src/couch_mrview_updater.erl index 7aee110..362df0e 100644 --- a/src/couch_mrview_updater.erl +++ b/src/couch_mrview_updater.erl @@ -241,6 +241,7 @@ insert_results(DocId, [KVs | RKVs], [{Id, VKVs} | RVKVs], VKVAcc, VIdKeys) -> {[KV | Rest], [{Id, Key} | IdKeys]} end, InitAcc = {[], VIdKeys}, + couch_stats:increment_counter([couchdb, couchjs, emits], length(KVs)), {Duped, VIdKeys0} = lists:foldl(CombineDupesFun, InitAcc, lists:sort(KVs)), FinalKVs = [{{Key, DocId}, Val} || {Key, Val} <- Duped] ++ VKVs, insert_results(DocId, RKVs, RVKVs, [{Id, FinalKVs} | VKVAcc], VIdKeys0).