From 089fe30d57baaec2b4f092201b1e5efaa9235ce7 Mon Sep 17 00:00:00 2001 From: Yannick Scherer Date: Fri, 17 Feb 2017 21:34:56 +0100 Subject: [PATCH] upgrade dependencies, adjust tests. - the push gateway is now apparently accessed using POST, - the collectors now complain if the same name is used multiple times. Closes #3. --- project.clj | 8 ++++---- test/iapetos/collector/ring_test.clj | 8 ++++---- test/iapetos/export_test.clj | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/project.clj b/project.clj index c7c5edf..243d09e 100644 --- a/project.clj +++ b/project.clj @@ -6,10 +6,10 @@ :year 2016 :key "mit"} :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"] - [io.prometheus/simpleclient "0.0.15"] - [io.prometheus/simpleclient_common "0.0.15"] - [io.prometheus/simpleclient_pushgateway "0.0.15"] - [io.prometheus/simpleclient_hotspot "0.0.15" :scope "provided"]] + [io.prometheus/simpleclient "0.0.20"] + [io.prometheus/simpleclient_common "0.0.20"] + [io.prometheus/simpleclient_pushgateway "0.0.20"] + [io.prometheus/simpleclient_hotspot "0.0.20" :scope "provided"]] :profiles {:dev {:dependencies [[org.clojure/test.check "0.9.0"] [aleph "0.4.1"]] diff --git a/test/iapetos/collector/ring_test.clj b/test/iapetos/collector/ring_test.clj index 25ceb1c..12bebee 100644 --- a/test/iapetos/collector/ring_test.clj +++ b/test/iapetos/collector/ring_test.clj @@ -95,12 +95,12 @@ wrap (gen/elements [ring/wrap-metrics-expose ring/wrap-metrics])] (let [registry (-> (registry-fn) (prometheus/register - (prometheus/counter :http/requests-total))) - on-request-fn #(prometheus/inc % :http/requests-total) + (prometheus/counter :http/scrape-requests-total))) + on-request-fn #(prometheus/inc % :http/scrape-requests-total) handler (-> (constantly {:status 200}) (wrap registry {:path path :on-request on-request-fn}))] - (and (zero? (prometheus/value (registry :http/requests-total))) + (and (zero? (prometheus/value (registry :http/scrape-requests-total))) (= 200 (:status (handler {:request-method :get, :uri path}))) - (= 1.0 (prometheus/value (registry :http/requests-total))))))) + (= 1.0 (prometheus/value (registry :http/scrape-requests-total))))))) diff --git a/test/iapetos/export_test.clj b/test/iapetos/export_test.clj index 0f6a546..267555d 100644 --- a/test/iapetos/export_test.clj +++ b/test/iapetos/export_test.clj @@ -42,8 +42,8 @@ result#)) (defn- matches-registry? - [{:keys [request-method headers body]} registry] - (and (= :put request-method) + [{:keys [request-method headers body] :as x} registry] + (and (= :post request-method) (= TextFormat/CONTENT_TYPE_004 (get headers "content-type")) (= (export/text-format registry) body)))