Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extract couch_stats in its own app.

couch_stats is now a full erlang application booted at startup. Other
changes are a better reinitialization of settings. Instead of exiting
the gen_server, we just load new settings and overwrite older.
  • Loading branch information...
commit 56c366e663613b1bb30d7a29dd226d30a0b2a45a 1 parent 29560d9
Benoit Chesneau benoitc authored
Showing with 828 additions and 62 deletions.
  1. +1 −3 apps/couch/src/couch.app.src
  2. +12 −1 apps/couch/src/couch_server_sup.erl
  3. +1 −1  apps/couch/src/couch_util.erl
  4. +0 −2  apps/couch/test/etap/001-load.t
  5. +1 −4 apps/couch_index/src/couch_index.app.src
  6. +505 −0 apps/couch_stats/LICENSE
  7. +75 −0 apps/couch_stats/NOTICE
  8. +8 −0 apps/couch_stats/ebin/couch_stats.app
  9. 0  apps/{couch → couch_stats}/priv/stat_descriptions.cfg
  10. +1 −0  apps/couch_stats/rebar.config
  11. +23 −0 apps/couch_stats/src/couch_stats.app.src
  12. +77 −34 apps/{couch → couch_stats}/src/couch_stats_aggregator.erl
  13. +23 −0 apps/couch_stats/src/couch_stats_app.erl
  14. +3 −3 apps/{couch → couch_stats}/src/couch_stats_collector.erl
  15. +30 −0 apps/couch_stats/src/couch_stats_sup.erl
  16. +7 −7 apps/{couch/test/etap → couch_stats/tests}/120-stats-collect.t
  17. 0  apps/{couch/test/etap → couch_stats/tests}/121-stats-aggregates.cfg
  18. 0  apps/{couch/test/etap → couch_stats/tests}/121-stats-aggregates.ini
  19. +3 −3 apps/{couch/test/etap → couch_stats/tests}/121-stats-aggregates.t
  20. +0 −4 example/rel/files/default.ini
  21. +50 −0 example/rel/files/stat_descriptions.cfg.sample
  22. +5 −0 example/rel/reltool.config
  23. +1 −0  rebar.config
  24. +2 −0  test/reltool.config
4 apps/couch/src/couch.app.src
View
@@ -12,12 +12,10 @@
couch_rep_sup,
couch_secondary_services,
couch_server,
- couch_stats_aggregator,
- couch_stats_collector,
couch_task_status
]},
{mod, {couch_app, []}},
{applications, [kernel, stdlib, crypto, lager, sasl, public_key, ssl,
- inets, os_mon]}
+ inets, os_mon, couch_stats]}
]}.
13 apps/couch/src/couch_server_sup.erl
View
@@ -112,7 +112,18 @@ stop() ->
config_change("daemons", _) ->
supervisor:terminate_child(couch_server_sup, couch_secondary_services),
- supervisor:restart_child(couch_server_sup, couch_secondary_services).
+ supervisor:restart_child(couch_server_sup,
+ couch_secondary_services);
+config_change("stat", "rate") ->
+ NewRate = integer_to_list(
+ couch_config:get_value("stats", "rate", "1000")
+ ),
+ couch_stats_aggregator:set_rate(NewRate);
+config_change("stats", "samples") ->
+ SampleStr = couch_config:get("stats", "samples", "[0]"),
+ {ok, Samples} = couch_util:parse_term(SampleStr),
+ couch_stats_aggregator:set_samples(Samples).
+
init(ChildSpecs) ->
{ok, ChildSpecs}.
2  apps/couch/src/couch_util.erl
View
@@ -28,7 +28,7 @@
-export([url_strip_password/1]).
-export([encode_doc_id/1]).
-export([with_db/2]).
--export([start_app_deps/1]).
+-export([start_app_deps/1, ensure_started/1]).
-export([capitalize/1]).
-export([json_decode/1]).
-export([get_uri/2, get_scheme/1, get_port/1]).
2  apps/couch/test/etap/001-load.t
View
@@ -39,8 +39,6 @@ main(_) ->
couch_ref_counter,
couch_server,
couch_server_sup,
- couch_stats_aggregator,
- couch_stats_collector,
couch_stream,
couch_task_status,
couch_util,
5 apps/couch_index/src/couch_index.app.src
View
@@ -13,10 +13,7 @@
{application, couch_index, [
{description, "CouchDB Secondary Index Manager"},
{vsn, "0.1"},
- {modules, [
- couch_index,
- couch_index_server
- ]},
+ {modules, []},
{registered, [couch_index_server]},
{applications, [kernel, stdlib, couch]},
{mod, {couch_index_app, []}}
505 apps/couch_stats/LICENSE
View
@@ -0,0 +1,505 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+Apache CouchDB Subcomponents
+
+The Apache CouchDB project includes a number of subcomponents with separate
+copyright notices and license terms. Your use of the code for the these
+subcomponents is subject to the terms and conditions of the following licenses.
+
+For the m4/ac_check_icu.m4 component:
+
+ Copyright (c) 2005 Akos Maroy <darkeye@tyrell.hu>
+
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved.
+
+For the share/www/script/jquery.js component:
+
+ Copyright (c) 2009 John Resig, http://jquery.com/
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For the share/www/script/jquery-ui-1.8.11.custom.min.js and
+ share/www/style/jquery-ui-1.8.11.custom.css components:
+
+ Copyright (c) 2011 Paul Bakaus, http://jqueryui.com/
+
+ This software consists of voluntary contributions made by many
+ individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
+ contribution history, see the revision history and logs, available
+ at http://jquery-ui.googlecode.com/svn/
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For the share/www/script/jquery.form.js component:
+
+ http://malsup.com/jquery/form/
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For the share/www/script/json2.js component:
+
+ Public Domain
+
+ No warranty expressed or implied. Use at your own risk.
+
+For the src/mochiweb component:
+
+ Copyright (c) 2007 Mochi Media, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For the src/ibrowse component:
+
+ Copyright (c) 2006, Chandrashekhar Mullaparthi
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the T-Mobile nor the names of its contributors may be
+ used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the src/erlang-oauth component:
+
+ Copyright (c) 2008-2009 Tim Fletcher <http://tfletcher.com/>
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+For the src/etap component:
+
+ Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+For the src/ejson/yajl component
+
+Copyright 2010, Lloyd Hilaiel.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. Neither the name of Lloyd Hilaiel nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+For the src/ejson/erl_nif_compat.h file
+
+ Copyright (c) 2010-2011 Basho Technologies, Inc.
+ With some minor modifications for Apache CouchDB.
+
+ This file is provided to you under the Apache License,
+ Version 2.0 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain
+ a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+For the src/snappy/google-snappy component
+
+ Copyright 2005 and onwards Google Inc.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the share/server/coffee-script.js file
+
+ Copyright (c) 2011 Jeremy Ashkenas
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
75 apps/couch_stats/NOTICE
View
@@ -0,0 +1,75 @@
+Apache CouchDB
+Copyright 2009-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+This product also includes the following third-party components:
+
+ * ac_check_icu.m4 (http://autoconf-archive.cryp.to/ac_check_icu.html)
+
+ Copyright 2008, Akos Maroy <darkeye@tyrell.hu>
+
+ * ac_check_curl.m4 (http://autoconf-archive.cryp.to/ac_check_curl.html)
+
+ Copyright 2008, Akos Maroy <darkeye@tyrell.hu>
+
+ * pkg.m4 (http://http://pkg-config.freedesktop.org/wiki/)
+
+ Copyright 2004, Scott James Remnant <scott@netsplit.com>
+
+ * jQuery (http://jquery.com/)
+
+ Copyright 2011, John Resig
+
+ * jQuery UI (http://jqueryui.com)
+
+ Copyright 2011, Paul Bakaus
+
+ * json2.js (http://www.json.org/)
+
+ In the public domain
+
+ * MochiWeb (http://code.google.com/p/mochiweb/)
+
+ Copyright 2007, Mochi Media Coporation
+
+ * ibrowse (http://github.com/cmullaparthi/ibrowse/tree/master)
+
+ Copyright 2009, Chandrashekhar Mullaparthi
+
+ * Erlang OAuth (http://github.com/tim/erlang-oauth/tree/master)
+
+ Copyright 2009, Tim Fletcher <http://tfletcher.com/>
+
+ * ETap (http://github.com/ngerakines/etap/)
+
+ Copyright 2009, Nick Gerakines <nick@gerakines.net>
+
+ * mimeparse.js (http://code.google.com/p/mimeparse/)
+
+ Copyright 2009, Chris Anderson <jchris@apache.org>
+
+ * base64.js
+
+ Copyright 1999, Masanao Izumo <iz@onicos.co.jp>
+
+ * jspec.js (http://visionmedia.github.com/jspec/)
+
+ Copyright 2010 TJ Holowaychuk <tj@vision-media.ca>
+
+ * yajl (http://lloyd.github.com/yajl/)
+
+ Copyright 2010, Lloyd Hilaiel
+
+ * snappy (http://code.google.com/p/snappy/)
+
+ Copyright 2005 and onwards Google Inc.
+
+ * snappy-erlang-nif (https://github.com/fdmanana/snappy-erlang-nif)
+
+ Copyright 2011, Filipe David Manana <fdmanana@apache.org>
+
+ * CoffeeScript (http://coffeescript.org/)
+
+ Copyright 2011, Jeremy Ashkenas
8 apps/couch_stats/ebin/couch_stats.app
View
@@ -0,0 +1,8 @@
+{application,couch_stats,
+ [{description,"CouchDB stats"},
+ {vsn,"0.1"},
+ {modules,[couch_stats_aggregator,couch_stats_app,
+ couch_stats_collector,couch_stats_sup]},
+ {registered,[couch_stats_aggregator,couch_stats_collector]},
+ {applications,[kernel,stdlib]},
+ {mod,{couch_stats_app,[]}}]}.
0  apps/couch/priv/stat_descriptions.cfg → apps/couch_stats/priv/stat_descriptions.cfg
View
File renamed without changes
1  apps/couch_stats/rebar.config
View
@@ -0,0 +1 @@
+{erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
23 apps/couch_stats/src/couch_stats.app.src
View
@@ -0,0 +1,23 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+{application, couch_stats, [
+ {description, "CouchDB stats"},
+ {vsn, "0.1"},
+ {modules, []},
+ {registered, [
+ couch_stats_aggregator,
+ couch_stats_collector
+ ]},
+ {applications, [kernel, stdlib]},
+ {mod, {couch_stats_app, []}}
+]}.
111 apps/couch/src/couch_stats_aggregator.erl → apps/couch_stats/src/couch_stats_aggregator.erl
View
@@ -13,7 +13,9 @@
-module(couch_stats_aggregator).
-behaviour(gen_server).
--export([start/0, start/1, stop/0]).
+-export([start_link/0, start_link/1,
+ stop/0,
+ set_samples/1, set_rate/1]).
-export([all/0, all/1, get/1, get/2, get_json/1, get_json/2, collect_sample/0]).
-export([init/1, terminate/2, code_change/3]).
@@ -33,17 +35,35 @@
samples = []
}).
+-record(state, {tref,
+ rate,
+ desc_fname,
+ samples}).
-start() ->
- PrivDir = couch_util:priv_dir(),
- start(filename:join(PrivDir, "stat_descriptions.cfg")).
-
-start(FileName) ->
+start_link() ->
+ PrivDir = case code:priv_dir(couch_stats) of
+ {error, _} ->
+ %% try to get relative priv dir. useful for tests.
+ EbinDir = filename:dirname(code:which(?MODULE)),
+ AppPath = filename:dirname(EbinDir),
+ filename:join(AppPath, "priv");
+ Dir -> Dir
+ end,
+
+ start_link(filename:join([PrivDir, "stat_descriptions.cfg"])).
+
+start_link(FileName) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [FileName], []).
stop() ->
gen_server:cast(?MODULE, stop).
+set_samples(Samples) ->
+ gen_server:call(?MODULE, {set_samples, Samples}, infinity).
+
+set_rate(Rate) ->
+ gen_server:call(?MODULE, {set_rate, Rate}).
+
all() ->
?MODULE:all(0).
all(Time) when is_binary(Time) ->
@@ -92,34 +112,18 @@ collect_sample() ->
init(StatDescsFileName) ->
% Create an aggregate entry for each {description, rate} pair.
ets:new(?MODULE, [named_table, set, protected]),
- SampleStr = couch_config:get("stats", "samples", "[0]"),
- {ok, Samples} = couch_util:parse_term(SampleStr),
- {ok, Descs} = file:consult(StatDescsFileName),
- lists:foreach(fun({Sect, Key, Value}) ->
- lists:foreach(fun(Secs) ->
- Agg = #aggregate{
- description=list_to_binary(Value),
- seconds=Secs
- },
- ets:insert(?MODULE, {{{Sect, Key}, Secs}, Agg})
- end, Samples)
- end, Descs),
-
- Self = self(),
- ok = couch_config:register(
- fun("stats", _) -> exit(Self, config_change) end
- ),
-
- Rate = list_to_integer(couch_config:get("stats", "rate", "1000")),
+ Samples = get_app_env(samples, [0]),
+ init_samples(Samples, StatDescsFileName),
+ Rate = get_app_env(rate, 1000),
% TODO: Add timer_start to kernel start options.
{ok, TRef} = timer:apply_after(Rate, ?MODULE, collect_sample, []),
- {ok, {TRef, Rate}}.
-
-terminate(_Reason, {TRef, _Rate}) ->
- timer:cancel(TRef),
- ok.
+ {ok, #state{tref=TRef,
+ rate=Rate,
+ desc_fname=StatDescsFileName,
+ samples=Samples}}.
-handle_call(collect_sample, _, {OldTRef, SampleInterval}) ->
+handle_call(collect_sample, _From, #state{tref=OldTRef,
+ rate=SampleInterval}=State) ->
timer:cancel(OldTRef),
{ok, TRef} = timer:apply_after(SampleInterval, ?MODULE, collect_sample, []),
% Gather new stats values to add.
@@ -137,7 +141,7 @@ handle_call(collect_sample, _, {OldTRef, SampleInterval}) ->
end, {0, 0}, Values2),
{Key, {absolute, Mean}}
end, couch_stats_collector:all(absolute)),
-
+
Values = Incs ++ Abs,
Now = erlang:now(),
lists:foreach(fun({{Key, Rate}, Agg}) ->
@@ -151,7 +155,16 @@ handle_call(collect_sample, _, {OldTRef, SampleInterval}) ->
end,
ets:insert(?MODULE, {{Key, Rate}, NewAgg})
end, ets:tab2list(?MODULE)),
- {reply, ok, {TRef, SampleInterval}}.
+ {reply, ok, State#state{tref=TRef}};
+
+handle_call({set_samples, Samples}, _From, #state{desc_fname=FName}=State) ->
+ init_samples(Samples, FName),
+ {reply, ok, State#state{samples=Samples}};
+
+handle_call({set_rate, Rate}, _From, #state{tref=OldTRef}=State) ->
+ timer:cancel(OldTRef),
+ {ok, TRef} = timer:apply_after(Rate, ?MODULE, collect_sample, []),
+ {reply, ok, State#state{tref=TRef, rate=Rate}}.
handle_cast(stop, State) ->
{stop, normal, State}.
@@ -162,6 +175,9 @@ handle_info(_Info, State) ->
code_change(_OldVersion, State, _Extra) ->
{ok, State}.
+terminate(_Reason, #state{tref=TRef}) ->
+ timer:cancel(TRef),
+ ok.
new_value(incremental, Value, null) ->
Value;
@@ -195,7 +211,7 @@ add_value(Time, Value, Agg) ->
variance=Variance,
samples=Samples
} = Agg,
-
+
NewCount = Count + 1,
NewMean = Mean + (Value - Mean) / NewCount,
NewVariance = Variance + (Value - Mean) * (Value - NewMean),
@@ -295,3 +311,30 @@ clamp_value(Val) when Val > 0.00000000000001 ->
Val;
clamp_value(_) ->
0.0.
+
+
+get_app_env(Env, Default) ->
+ case application:get_env(couch_stats, Env) of
+ {ok, Val} -> Val;
+ undefined -> Default
+ end.
+
+
+init_samples(Samples, StatDescsFileName) ->
+ {ok, Descs} = file:consult(StatDescsFileName),
+ lists:foreach(fun({Sect, Key, Value}) ->
+ lists:foreach(fun(Secs) ->
+ Agg = #aggregate{
+ description=to_binary(Value),
+ seconds=Secs
+ },
+ ets:insert(?MODULE, {{{Sect, Key}, Secs}, Agg})
+ end, Samples)
+ end, Descs),
+ ok.
+
+
+to_binary(Value) when is_list(Value) ->
+ list_to_binary(Value);
+to_binary(Value) ->
+ Value.
23 apps/couch_stats/src/couch_stats_app.erl
View
@@ -0,0 +1,23 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_stats_app).
+
+-behaviour(application).
+
+-export([start/2, stop/1]).
+
+start(_Type, _Args) ->
+ couch_stats_sup:start_link().
+
+stop(_) ->
+ ok.
6 apps/couch/src/couch_stats_collector.erl → apps/couch_stats/src/couch_stats_collector.erl
View
@@ -18,7 +18,7 @@
-behaviour(gen_server).
--export([start/0, stop/0]).
+-export([start_link/0, stop/0]).
-export([all/0, all/1, get/1, increment/1, decrement/1, record/2, clear/1]).
-export([track_process_count/1, track_process_count/2]).
@@ -28,7 +28,7 @@
-define(HIT_TABLE, stats_hit_table).
-define(ABS_TABLE, stats_abs_table).
-start() ->
+start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
stop() ->
@@ -133,4 +133,4 @@ abs_to_list() ->
Others ->
[{Key, [Val]} | Others]
end
- end, [], SortedKVs).
+ end, [], SortedKVs).
30 apps/couch_stats/src/couch_stats_sup.erl
View
@@ -0,0 +1,30 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_stats_sup).
+-behaviour(supervisor).
+
+-export([start_link/0]).
+-export([init/1]).
+
+
+%% Helper macro for declaring children of supervisor
+-define(CHILD(I), {I, {I, start_link, []}, permanent, 5000, worker, [I]}).
+
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+
+init([]) ->
+ Aggregator = ?CHILD(couch_stats_aggregator),
+ Collector = ?CHILD(couch_stats_collector),
+ {ok, {{one_for_one, 10, 3600}, [Aggregator, Collector]}}.
14 apps/couch/test/etap/120-stats-collect.t → apps/couch_stats/tests/120-stats-collect.t
View
@@ -26,7 +26,7 @@ main(_) ->
ok.
test() ->
- couch_stats_collector:start(),
+ couch_stats_collector:start_link(),
ok = test_counters(),
ok = test_abs_values(),
ok = test_proc_counting(),
@@ -63,7 +63,7 @@ test_abs_values() ->
lists:seq(1, 15),
"Absolute values are recorded correctly."
),
-
+
couch_stats_collector:clear(bar),
etap:is(
couch_stats_collector:get(bar),
@@ -86,7 +86,7 @@ test_proc_counting() ->
1,
"track_process_count incrememnts the counter."
),
-
+
TwicePid = spawn(fun() ->
couch_stats_collector:track_process_count(hoopla),
couch_stats_collector:track_process_count(hoopla),
@@ -100,7 +100,7 @@ test_proc_counting() ->
3,
"track_process_count allows more than one incrememnt per Pid"
),
-
+
OnePid ! sepuku,
receive {'DOWN', R1, _, _, _} -> ok end,
timer:sleep(250),
@@ -109,7 +109,7 @@ test_proc_counting() ->
2,
"Process count is decremented when process exits."
),
-
+
TwicePid ! sepuku,
receive {'DOWN', R2, _, _, _} -> ok end,
timer:sleep(250),
@@ -128,13 +128,13 @@ test_all() ->
[{foo, 0}, {hoopla, 0}, {bar, [1.0, 0.0]}],
"all/0 returns all counters and absolute values."
),
-
+
etap:is(
couch_stats_collector:all(incremental),
[{foo, 0}, {hoopla, 0}],
"all/1 returns only the specified type."
),
-
+
couch_stats_collector:record(zing, 90),
etap:is(
couch_stats_collector:all(absolute),
0  apps/couch/test/etap/121-stats-aggregates.cfg → apps/couch_stats/tests/121-stats-aggregates.cfg
View
File renamed without changes
0  apps/couch/test/etap/121-stats-aggregates.ini → apps/couch_stats/tests/121-stats-aggregates.ini
View
File renamed without changes
6 apps/couch/test/etap/121-stats-aggregates.t → apps/couch_stats/tests/121-stats-aggregates.t
View
@@ -32,9 +32,9 @@ main(_) ->
ok.
test() ->
- couch_config:start_link([ini_file()]),
- couch_stats_collector:start(),
- couch_stats_aggregator:start(cfg_file()),
+ couch_config:start([ini_file()]),
+ couch_stats_collector:start_link(),
+ couch_stats_aggregator:start_link(cfg_file()),
ok = test_all_empty(),
ok = test_get_empty(),
ok = test_count_stats(),
4 example/rel/files/default.ini
View
@@ -100,10 +100,6 @@ os_process_limit = 25
index_server={couch_index_server, start_link, []}
external_manager={couch_external_manager, start_link, []}
query_servers={couch_query_servers, start_link, []}
-vhosts={couch_httpd_vhost, start_link, []}
-httpd={couch_httpd, start_link, []}
-stats_aggregator={couch_stats_aggregator, start, []}
-stats_collector={couch_stats_collector, start, []}
uuids={couch_uuids, start, []}
auth_cache={couch_auth_cache, start_link, []}
os_daemons={couch_os_daemons, start_link, []}
50 example/rel/files/stat_descriptions.cfg.sample
View
@@ -0,0 +1,50 @@
+%% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+%% use this file except in compliance with the License. You may obtain a copy of
+%% the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+%% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+%% License for the specific language governing permissions and limitations under
+%% the License.
+
+% Style guide for descriptions: Start with a lowercase letter & do not add
+% a trailing full-stop / period
+% Please keep this in alphabetical order
+
+{couchdb, database_writes, "number of times a database was changed"}.
+{couchdb, database_reads, "number of times a document was read from a database"}.
+{couchdb, open_databases, "number of open databases"}.
+{couchdb, open_os_files, "number of file descriptors CouchDB has open"}.
+{couchdb, request_time, "length of a request inside CouchDB without MochiWeb"}.
+{couchdb, auth_cache_hits, "number of authentication cache hits"}.
+{couchdb, auth_cache_misses, "number of authentication cache misses"}.
+
+{httpd, bulk_requests, "number of bulk requests"}.
+{httpd, requests, "number of HTTP requests"}.
+{httpd, temporary_view_reads, "number of temporary view reads"}.
+{httpd, view_reads, "number of view reads"}.
+{httpd, clients_requesting_changes, "number of clients for continuous _changes"}.
+
+{httpd_request_methods, 'COPY', "number of HTTP COPY requests"}.
+{httpd_request_methods, 'DELETE', "number of HTTP DELETE requests"}.
+{httpd_request_methods, 'GET', "number of HTTP GET requests"}.
+{httpd_request_methods, 'HEAD', "number of HTTP HEAD requests"}.
+{httpd_request_methods, 'POST', "number of HTTP POST requests"}.
+{httpd_request_methods, 'PUT', "number of HTTP PUT requests"}.
+
+{httpd_status_codes, '200', "number of HTTP 200 OK responses"}.
+{httpd_status_codes, '201', "number of HTTP 201 Created responses"}.
+{httpd_status_codes, '202', "number of HTTP 202 Accepted responses"}.
+{httpd_status_codes, '301', "number of HTTP 301 Moved Permanently responses"}.
+{httpd_status_codes, '304', "number of HTTP 304 Not Modified responses"}.
+{httpd_status_codes, '400', "number of HTTP 400 Bad Request responses"}.
+{httpd_status_codes, '401', "number of HTTP 401 Unauthorized responses"}.
+{httpd_status_codes, '403', "number of HTTP 403 Forbidden responses"}.
+{httpd_status_codes, '404', "number of HTTP 404 Not Found responses"}.
+{httpd_status_codes, '405', "number of HTTP 405 Method Not Allowed responses"}.
+{httpd_status_codes, '409', "number of HTTP 409 Conflict responses"}.
+{httpd_status_codes, '412', "number of HTTP 412 Precondition Failed responses"}.
+{httpd_status_codes, '500', "number of HTTP 500 Internal Server Error responses"}.
5 example/rel/reltool.config
View
@@ -20,7 +20,9 @@
oauth,
jiffy,
snappy,
+ couch_stats,
couch,
+ couch_httpd,
couch_index,
couch_mrview,
couch_changes,
@@ -49,7 +51,9 @@
{app, ibrowse, [{incl_cond, include}]},
%% couchdb
+ {app, couch_stats, [{incl_cond, include}]},
{app, couch, [{incl_cond, include}]},
+ {app, couch_httpd, [{incl_cond, include}]},
{app, couch_index, [{incl_cond, include}]},
{app, couch_mrview, [{incl_cond, include}]},
{app, couch_changes, [{incl_cond, include}]},
@@ -72,5 +76,6 @@
{template, "files/default.ini", "etc/default.ini"},
{template, "files/local.ini", "etc/local.ini"},
{copy, "../apps/couch/share"},
+ {copy, "../apps/couch_httpd/share/www", "share/www"},
{copy, "../apps/couch/couchjs", "bin/couchjs"}
]}.
1  rebar.config
View
@@ -17,6 +17,7 @@
{sub_dirs, [
+ "apps/couch_stats",
"apps/couch",
"apps/couch_httpd",
"apps/couch_index",
2  test/reltool.config
View
@@ -20,6 +20,7 @@
oauth,
jiffy,
snappy,
+ couch_stats,
couch,
couch_httpd,
couch_index,
@@ -50,6 +51,7 @@
{app, ibrowse, [{incl_cond, include}]},
%% couchdb
+ {app, couch_stats, [{incl_cond, include}]},
{app, couch, [{incl_cond, include}]},
{app, couch_httpd, [{incl_cond, include}]},
{app, couch_index, [{incl_cond, include}]},
Please sign in to comment.
Something went wrong with that request. Please try again.