clj-http-client/project.clj

58 lines
2.5 KiB
Clojure
Raw Normal View History

2017-02-09 22:30:16 +00:00
(defproject puppetlabs/http-client "0.8.1-SNAPSHOT"
:description "HTTP client wrapper"
:license {:name "Apache License, Version 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:min-lein-version "2.7.1"
:parent-project {:coords [puppetlabs/clj-parent "0.6.1"]
:inherit [:managed-dependencies]}
;; Abort when version ranges or version conflicts are detected in
;; dependencies. Also supports :warn to simply emit warnings.
;; requires lein 2.2.0+.
:pedantic? :abort
:dependencies [[org.clojure/clojure]
[org.apache.httpcomponents/httpasyncclient "4.1.2"]
[prismatic/schema]
[commons-io]
(TK-316) Add metrics support This commit adds metrics support to the http client (clojure and java, sync and async). A metric registry can optionally be passed into the client as a client option on creation. If a metric registry is present, timers will be added to time each request. By default, a timer is added for the URL (stripped of username, password, query string, and path fragments) and the URL plus the method used for the request. In addition, a request can include a `metric-id` option, which takes a tuple of metric ids. If this request option is specified, a timer will be created for each element of the metric id tuple - thus if the tuple is [:foo :bar :baz] there will be a foo timer, a foo.bar timer, and a foo.bar.baz timer. In addition, each timer has a "MetricType" - currently there is only one metric type, bytes-read, which is stopped when the full response has been read. In the future, we may add "response-init" timers that get stopped when the first byte of the response has been read. This commit also adds a `get-client-metrics`/`.getClientMetrics` function that takes a client instance and returns the http client-specific metrics from the metric registry and a `get-client-metrics-data`/`.getClientMetricsData` function for clojure and java sync and async clients to get out metrics data from the client. This function takes a client instance and returns a map of metric name to a map of metric data (for clojure) or a ClientMetricData object (for java), both of which include the mean, count, and aggregate for the timer These `get-client-metrics*`/`.getClientMetrics*` functions also have versions that take a url, url and method, or metric id to allow for filtering of the timers/metrics data returned by these functions. The clojure versions of these functions take a metric filter map. There are also metric filter builder functions to build up the type of metric filter desired from a url, a url and method, or a metric id. These will prevent users from having to know the specifics of how to build a metric themselves; instead they can use a convenience function. An empty metric id can be passed in to the filter to return all metric-id timers.
2016-02-26 05:39:21 +00:00
[io.dropwizard.metrics/metrics-core "3.1.2"]
[puppetlabs/ssl-utils]
[puppetlabs/i18n]]
2014-03-12 20:38:42 +00:00
2014-03-27 19:46:44 +00:00
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:jar-exclusions [#".*\.java$"]
;; By declaring a classifier here and a corresponding profile below we'll get an additional jar
;; during `lein jar` that has all the source code (including the java source). Downstream projects can then
;; depend on this source jar using a :classifier in their :dependencies.
:classifiers [["sources" :sources-jar]]
2014-03-27 19:46:44 +00:00
:profiles {:dev {:dependencies [[cheshire]
[puppetlabs/kitchensink nil :classifier "test"]
[puppetlabs/trapperkeeper]
[puppetlabs/trapperkeeper nil :classifier "test"]
[puppetlabs/trapperkeeper-webserver-jetty9]
[puppetlabs/trapperkeeper-webserver-jetty9 nil :classifier "test"]
[puppetlabs/ring-middleware]]
;; TK-143, enable SSLv3 for unit tests that exercise SSLv3
:jvm-opts ["-Djava.security.properties=./dev-resources/java.security"]}
:sources-jar {:java-source-paths ^:replace []
:jar-exclusions ^:replace []
:source-paths ^:replace ["src/clj" "src/java"]}}
2014-03-12 20:38:42 +00:00
:deploy-repositories [["releases" {:url "https://clojars.org/repo"
:username :env/clojars_jenkins_username
:password :env/clojars_jenkins_password
:sign-releases false}]]
:lein-release {:scm :git
:deploy-via :lein-deploy}
2014-03-12 20:38:42 +00:00
:plugins [[lein-parent "0.3.1"]
[puppetlabs/i18n "0.8.0"]])