Liking cljdoc? Tell your friends :D

clj-http.middleware.metrics

Functions to build clj-http middlewares that report timing metrics.

Functions to build clj-http middlewares that report timing metrics.
raw docstring

build-wrap-metricsclj

(build-wrap-metrics title-fn)
(build-wrap-metrics registry title-fn)

Creates a clj-http middleware that reports timing metrics.

NOTE: The middleware produced currently only supports synchronous operations.

title-fn is a function that accepts a request and returns a title. The title may be a dot-delimited string (e.g., a.b.c) or a sequence of strings (e.g., ["a" "b" "c"].

registry is an optional parameter that is a com.codahale.metrics.MetricRegistry. If one is not provided, the metrics.core/default-registry will be used.

Creates a clj-http middleware that reports timing metrics.

NOTE: The middleware produced currently only supports synchronous operations.

`title-fn` is a function that accepts a request and returns a title. The title
may be a dot-delimited string (e.g., `a.b.c`) or a sequence of strings (e.g.,
`["a" "b" "c"]`.

`registry` is an optional parameter that is a
`com.codahale.metrics.MetricRegistry`. If one is not provided, the
`metrics.core/default-registry` will be used.
sourceraw docstring

prefixed-title-fnclj

(prefixed-title-fn title-fn prefix)

Creates a new title-fn that applies the prefix to the output of title-fn.

Creates a new title-fn that applies the prefix to the output of title-fn.
sourceraw docstring

title-from-urlclj

(title-from-url {:keys [url]})

Generates a metric title in sequential form from the provided URL.

This function is designed to operate on a clj-http request and can be used as a title-fn for build-wrap-metrics.

The produced title will be in the following form contain the reversed hostname followed by the path, in sequential form. For example, the URL http://subdomain.example.com/some/path would be transformed into the following title:

["com" "example" "subdomain" "some" "path"]

Generates a metric title in sequential form from the provided URL.

This function is designed to operate on a clj-http request and can be used as
a `title-fn` for [[build-wrap-metrics]].

The produced title will be in the following form contain the reversed hostname
followed by the path, in sequential form. For example, the URL
`http://subdomain.example.com/some/path` would be transformed into the
following title:

`["com" "example" "subdomain" "some" "path"]`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close