Skip to content

Commit

Permalink
upgrade dependencies, adjust tests.
Browse files Browse the repository at this point in the history
- the push gateway is now apparently accessed using POST,
- the collectors now complain if the same name is used multiple times.

Closes #3.
  • Loading branch information
Yannick Scherer committed Feb 17, 2017
1 parent 259cd5d commit 089fe30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
Expand Down
8 changes: 4 additions & 4 deletions test/iapetos/collector/ring_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))))
4 changes: 2 additions & 2 deletions test/iapetos/export_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 089fe30

Please sign in to comment.