2016-09-30 21:48:58 +00:00
|
|
|
(def ks-version "1.3.0")
|
|
|
|
(def tk-version "1.5.1")
|
2015-12-18 20:21:27 +00:00
|
|
|
(def tk-jetty-version "1.5.0")
|
2016-12-06 21:55:46 +00:00
|
|
|
(def i18n-version "0.4.3")
|
2014-03-29 00:33:27 +00:00
|
|
|
|
2016-12-06 22:45:29 +00:00
|
|
|
(defproject puppetlabs/http-client "0.7.1-SNAPSHOT"
|
2014-03-12 20:45:29 +00:00
|
|
|
:description "HTTP client wrapper"
|
|
|
|
:license {:name "Apache License, Version 2.0"
|
|
|
|
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
|
|
|
|
|
2014-04-25 21:55:31 +00:00
|
|
|
;; 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
|
|
|
|
|
2015-12-18 20:21:27 +00:00
|
|
|
:dependencies [[org.clojure/clojure "1.7.0"]
|
|
|
|
|
2016-09-26 23:32:07 +00:00
|
|
|
[org.apache.httpcomponents/httpasyncclient "4.1.2"]
|
(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
|
|
|
[org.apache.commons/commons-lang3 "3.4"]
|
2015-12-18 20:21:27 +00:00
|
|
|
[prismatic/schema "1.0.4"]
|
2016-09-30 21:48:58 +00:00
|
|
|
[org.slf4j/slf4j-api "1.7.20"]
|
2015-12-18 20:21:27 +00:00
|
|
|
[commons-io "2.4"]
|
(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"]
|
2015-12-18 20:21:27 +00:00
|
|
|
|
2016-10-17 17:34:36 +00:00
|
|
|
[puppetlabs/ssl-utils "0.8.1"]
|
2016-12-06 21:55:46 +00:00
|
|
|
[puppetlabs/i18n ~i18n-version]]
|
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"]
|
2014-04-25 21:55:31 +00:00
|
|
|
: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
|
|
|
|
2014-03-29 00:33:27 +00:00
|
|
|
:profiles {:dev {:dependencies [[puppetlabs/kitchensink ~ks-version :classifier "test"]
|
|
|
|
[puppetlabs/trapperkeeper ~tk-version]
|
|
|
|
[puppetlabs/trapperkeeper ~tk-version :classifier "test"]
|
2015-03-16 17:50:09 +00:00
|
|
|
[puppetlabs/trapperkeeper-webserver-jetty9 ~tk-jetty-version]
|
2015-12-18 20:21:27 +00:00
|
|
|
[puppetlabs/trapperkeeper-webserver-jetty9 ~tk-jetty-version :classifier "test"]]
|
2015-02-13 01:05:06 +00:00
|
|
|
;; TK-143, enable SSLv3 for unit tests that exercise SSLv3
|
|
|
|
:jvm-opts ["-Djava.security.properties=./dev-resources/java.security"]}
|
2014-04-25 21:55:31 +00:00
|
|
|
:sources-jar {:java-source-paths ^:replace []
|
|
|
|
:jar-exclusions ^:replace []
|
2014-04-28 18:32:42 +00:00
|
|
|
:source-paths ^:replace ["src/clj" "src/java"]}}
|
2014-03-29 00:33:27 +00:00
|
|
|
|
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
|
2014-03-12 20:45:29 +00:00
|
|
|
:deploy-via :lein-deploy}
|
2014-03-12 20:38:42 +00:00
|
|
|
|
2016-10-17 18:10:06 +00:00
|
|
|
:plugins [[lein-release "1.0.5" :exclusions [org.clojure/clojure]]
|
2016-12-06 21:55:46 +00:00
|
|
|
[puppetlabs/i18n ~i18n-version]])
|