You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2021/04/14 00:23:48 UTC

[couchdb] 05/05: add license to missing files

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

tonysun83 pushed a commit to branch port-prometheus-3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit cc3bd78dd2fddc1e7be46dbe8a3f62726b70da39
Author: Tony Sun <to...@gmail.com>
AuthorDate: Tue Apr 13 11:12:55 2021 -0700

    add license to missing files
---
 src/couch_prometheus/src/couch_prometheus_http.erl        | 15 ++++++++++++++-
 .../test/eunit/couch_prometheus_e2e_tests.erl             |  5 -----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/couch_prometheus/src/couch_prometheus_http.erl b/src/couch_prometheus/src/couch_prometheus_http.erl
index c123a38..bd0c4c6 100644
--- a/src/couch_prometheus/src/couch_prometheus_http.erl
+++ b/src/couch_prometheus/src/couch_prometheus_http.erl
@@ -1,3 +1,15 @@
+% 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_prometheus_http).
 
 -compile(tuple_calls).
@@ -35,7 +47,8 @@ start_link() ->
 handle_request(MochiReq) ->
     RawUri = MochiReq:get(raw_path),
     {"/" ++ Path, _, _} = mochiweb_util:urlsplit_path(RawUri),
-    PathParts =  string:tokens(Path, "/"),    try
+    PathParts =  string:tokens(Path, "/"),
+    try
         case PathParts of
             ["_node", Node, "_prometheus"] ->
                 send_prometheus(MochiReq, Node);
diff --git a/src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl b/src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl
index 4bfbdd9..c862b9a 100644
--- a/src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl
+++ b/src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl
@@ -124,11 +124,6 @@ create_db(Url) ->
     Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
     Port = mochiweb_socket_server:get(chttpd, port),
     {ok, Status, _, _} = test_request:put(Url, [?CONTENT_JSON, ?AUTH], "{}"),
-    case Status of
-        201 -> ok;
-        202 -> ok;
-        _ -> io:format(user, "~n HTTP Status Code: ~p~n", [Status])
-    end,
     ?assert(Status =:= 201 orelse Status =:= 202).
 
 delete_db(Url) ->