This is a pretty thin wrapper of Coda Hale (https://metrics.dropwizard.io). Unlike the metrics-clojure library (https://github.com/metrics-clojure/metrics-clojure), this doesn't destroy your ability to program to interfaces common to the different kinds of metrics.
The one major constraint this wrapper adds is that you must supply a docstring when you create metrics. Do it. Don't cheat. We don't need anonymous mysterious metrics out there. If it's worth recording, it's worth saying what it is!!
On that note, you can get explanations for each metric with (explanation) and (explain).
This is a pretty thin wrapper of Coda Hale (https://metrics.dropwizard.io). Unlike the metrics-clojure library (https://github.com/metrics-clojure/metrics-clojure), this doesn't destroy your ability to program to interfaces common to the different kinds of metrics. The one major constraint this wrapper adds is that you must supply a docstring when you create metrics. Do it. Don't cheat. We don't need anonymous mysterious metrics out there. If it's worth recording, it's worth saying what it is!! On that note, you can get explanations for each metric with (explanation) and (explain).
(console-reporter registry)
A simple console reporter for debugging/dev purposes.
A simple console reporter for debugging/dev purposes.
(count metric)
Returns the count recorded by this metric.
Returns the count recorded by this metric.
(counter explanation)
Creates a codahale counter [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Counter.html] with the provided explanation string.
Creates a codahale counter [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Counter.html] with the provided explanation string.
(counters reg)
(counters reg filter)
Returns a map name->metric for all counters registered in this registry.
Returns a map name->metric for all counters registered in this registry.
(decrement counter)
(decrement counter n)
Decrement a counter by 1 or by the amount specified.
Decrement a counter by 1 or by the amount specified.
(default-registry)
Default registry available for use by all consumers of barometer
Default registry available for use by all consumers of barometer
(ensure-name name-repr)
Metric names can be specified as either a dotted string or a vector of strings.
Metric names can be specified as either a dotted string or a vector of strings.
(explain this)
Prints a string containing the documentation for this thing.
Prints a string containing the documentation for this thing.
(explanation this)
Returns a string containing the documentation for this thing.
Returns a string containing the documentation for this thing.
(fifteen-minute-rate metric)
Gives the frequency with which this metric was triggered in the last fifteen minutes.
Gives the frequency with which this metric was triggered in the last fifteen minutes.
(five-minute-rate metric)
Gives the frequency with which this metric was triggered in the last five minutes.
Gives the frequency with which this metric was triggered in the last five minutes.
(gauge fn explanation)
Creates a codahale gauge [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Gauge.html] with the provided explanation string.
Creates a codahale gauge [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Gauge.html] with the provided explanation string.
(gauges reg)
(gauges reg filter)
Returns a map name->metric for all gauges registered in this registry.
Returns a map name->metric for all gauges registered in this registry.
(get-metric reg name)
Retrieves the metric registered under this name. Returns nil if none is found.
Retrieves the metric registered under this name. Returns nil if none is found.
(get-or-register reg name construction-form)
If a metric is already registered under this name, get-or-register simply returns that metric. Otherwise, 'construction-form' is evaluated and its result (a metric, presumably) is registered. Example: (def my-metric (get-or-register registry 'my-name (meter "A meter!")))
If a metric is already registered under this name, get-or-register simply returns that metric. Otherwise, 'construction-form' is evaluated and its result (a metric, presumably) is registered. Example: (def my-metric (get-or-register registry 'my-name (meter "A meter!")))
(graphite-reporter registry graphite-url graphite-port)
(graphite-reporter registry graphite-url graphite-port prefix)
A reporter for streaming metrics to a graphite server. http://graphiteapp.org
A reporter for streaming metrics to a graphite server. http://graphiteapp.org
(histogram reservoir explanation)
Creates a codahale histogram [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Histogram.html with the provided explanation string.
Creates a codahale histogram [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Histogram.html with the provided explanation string.
(histograms reg)
(histograms reg filter)
Returns a map name->metric for all histograms registered in this registry.
Returns a map name->metric for all histograms registered in this registry.
(increment counter)
(increment counter n)
Increment a counter by 1 or by the amount specified.
Increment a counter by 1 or by the amount specified.
(max o)
Gives the maximum value captured by this metric/snapshot.
Gives the maximum value captured by this metric/snapshot.
(mean o)
Gives the mean value recorded by this metric/snapshot.
Gives the mean value recorded by this metric/snapshot.
(mean-rate metric)
Gives the mean frequency with which this metric has been triggered.
Gives the mean frequency with which this metric has been triggered.
(median o)
Gives the median value recorded by this metric/snapshot.
Gives the median value recorded by this metric/snapshot.
(meter explanation)
(meter clock explanation)
Creates a codahale meter [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Meter.html] with the provided explanation string.
Creates a codahale meter [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Meter.html] with the provided explanation string.
(meters reg)
(meters reg filter)
Returns a map name->metric for all meters registered in this registry.
Returns a map name->metric for all meters registered in this registry.
(metric-filter f)
Pass in a function that takes arguments name-of-metric and metric. It should return a truthy value if the filter matches.
Pass in a function that takes arguments name-of-metric and metric. It should return a truthy value if the filter matches.
(metrics ms)
Returns a map name->metric for all metrics contained by this metric set.
Returns a map name->metric for all metrics contained by this metric set.
(min o)
Gives the minimum value captured by this metric/snapshot.
Gives the minimum value captured by this metric/snapshot.
(names reg)
Returns a set containing all the names registered in this registry.
Returns a set containing all the names registered in this registry.
(one-minute-rate metric)
Gives the frequency with which this metric was triggered in the last five minutes.
Gives the frequency with which this metric was triggered in the last five minutes.
(quantile o q)
Gives the value recorded by this metric/snapshot in the specified quantile.
Gives the value recorded by this metric/snapshot in the specified quantile.
(register reg name metric)
Registers the given metric to the given name in this registry. If a metric is already registered under this name, it is replaced and a warning is logged.
Registers the given metric to the given name in this registry. If a metric is already registered under this name, it is replaced and a warning is logged.
(register-all reg name->metric)
(register-all reg prefix name->metric)
Registers to the given names the corresponding metrics. If a metric is already registered under this name, it is replaced and a warning is logged.
Registers to the given names the corresponding metrics. If a metric is already registered under this name, it is replaced and a warning is logged.
(registry)
(registry explanation)
The explanation is optional.
The explanation is optional.
(remove-matching reg filter)
Removes from this registry any metric that matches the given filter.
Removes from this registry any metric that matches the given filter.
(remove-metric reg name)
Removes from this registry any metric registered under the given name.
Removes from this registry any metric registered under the given name.
(size o)
Gives the number of values recorded by this metric/snapshot.
Gives the number of values recorded by this metric/snapshot.
(snapshot metric)
Gives an instantaneous snapshot of the statistical properties of the metric.
Gives an instantaneous snapshot of the statistical properties of the metric.
(std-dev o)
Gives the standard deviation of the value recorded by this metric/snapshot.
Gives the standard deviation of the value recorded by this metric/snapshot.
(time metric fn)
Runs the fn, returns its return value.
Runs the fn, returns its return value.
(timer explanation)
(timer reservoir explanation)
(timer reservoir clock explanation)
Creates a codahale timer [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Timer.html] with the provided explanation string.
Creates a codahale timer [https://metrics.dropwizard.io/3.2.0/apidocs/com/codahale/metrics/Timer.html] with the provided explanation string.
(timers reg)
(timers reg filter)
Returns a map name->metric for all timers registered in this registry.
Returns a map name->metric for all timers registered in this registry.
(update metric)
(update metric value)
Updates with number of occurrences, or latest value, or whatever it makes sense to tick/mark/update this metric with.
Updates with number of occurrences, or latest value, or whatever it makes sense to tick/mark/update this metric with.
(value metric)
For metrics that record a single value, this returns it.
For metrics that record a single value, this returns it.
(values o)
Gives an array of all values captured by this metric/snapshot.
Gives an array of all values captured by this metric/snapshot.
(vomit-all-timers registry)
Named in accordance with the sense that this is not how things should be done if we happened to take the time to decide how to do such things instead of simply doing them.
Returns a nested map of stats reported by all timers registered in the registry.
Named in accordance with the sense that this is not how things should be done if we happened to take the time to decide how to do such things instead of simply doing them. Returns a nested map of stats reported by all timers registered in the registry.
(vomit-timer timer)
Named in accordance with the sense that this is not how things should be done if we happened to take the time to decide how to do such things instead of simply doing them.
Returns a map of stats reported by the timer.
Named in accordance with the sense that this is not how things should be done if we happened to take the time to decide how to do such things instead of simply doing them. Returns a map of stats reported by the timer.
(with-timer timer & body)
Times the execution of the body, even if an exception is thrown.
Times the execution of the body, even if an exception is thrown.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close