diff options
author | Tony Sun <tony.sun427@gmail.com> | 2021-04-13 11:12:55 -0700 |
---|---|---|
committer | Tony Sun <tony.sun427@gmail.com> | 2021-06-01 14:10:38 -0700 |
commit | 68166ee27f3d9df40c1ee2aa1a464b546e432221 (patch) | |
tree | 9b2e670adbdb41dd8ad6a0cc8b582818f29b90de | |
parent | d724d643585a74a85eb17da306752c2aacc9a20d (diff) | |
download | couchdb-68166ee27f3d9df40c1ee2aa1a464b546e432221.tar.gz |
add license to missing files
-rw-r--r-- | src/couch_prometheus/src/couch_prometheus_http.erl | 15 | ||||
-rw-r--r-- | src/couch_prometheus/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 c123a3892..bd0c4c6f9 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 4bfbdd940..c862b9a9f 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) -> |