(active-threads)Params: no params.
Returns: Long - number of active threads.
# Detect an estimate of the number of active threads in the current thread's thread group and its subgroups. * Params: no params. * Returns: _Long_ - number of active threads.
(console-reporter registry report-period report-units)Params:
registry - com.codahale.metrics.MetricRegistry instance.
report-period - Long number of units for report period. (e.g. 10)
report-units - java.util.concurrent.TimeUnit instance (e.g. TimeUnit/SECONDS)
Returns: nil.
# Create console reporter for given registry and start it. * Params: **`registry`** - `com.codahale.metrics.MetricRegistry` instance. **`report-period`** - _Long_ number of units for report period. (e.g. 10) **`report-units`** - `java.util.concurrent.TimeUnit` instance (e.g. TimeUnit/SECONDS) * Returns: _nil_.
(counter registry metric-name delta)Update a single Numeric/Long metric by the delta amount.
Update a single Numeric/Long metric by the `delta` amount.
(free-jvm-mem & {:keys [unit] :or {unit :mb}})Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Example: (free-jvm-mem) and (free-jvm-mem :unit :mb) returns free memory in megabytes.
Returns: Long - amount of free memory in bytes or in memory units.
# Get the amount of free memory in the Java Virtual Machine.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Example:
(free-jvm-mem) and (free-jvm-mem :unit :mb) returns free memory in megabytes.
* Returns:
_Long_ - amount of free memory in bytes or in memory units.(free-swap-size & {:keys [unit] :or {unit :mb}})Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Returns: value - Long number of free swap size in bytes or in memory units.
# Detect free swap size.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Returns:
_value_ - _Long_ number of free swap size in bytes or in memory units.(gauge registry metric-name value-fn)Register a single metric value, returned by a 0-arg function. This function will be called everytime the Guage value is requested.
Register a single metric value, returned by a 0-arg function. This function will be called everytime the Guage value is requested.
(histogram registry metric-name value)Measure a distribution of Long values.
Measure a distribution of Long values.
(jmx-reporter registry)Domain name is "middlesphere.metrics".
Example:
Run java app with args: -Dcom.sun.management.jmxremote.port=10999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
Attach jconsole: jconsole localhost:10999
See domain - middlesphere.metrics
Params:
registry - com.codahale.metrics.MetricRegistry instance.
Returns: nil.
# Create JMX reporter for given registry and start it.
Domain name is "middlesphere.metrics".
Example:
1. Run java app with args: -Dcom.sun.management.jmxremote.port=10999
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
2. Attach jconsole: jconsole localhost:10999
3. See domain - middlesphere.metrics
* Params:
**`registry`** - `com.codahale.metrics.MetricRegistry` instance.
* Returns:
_nil_.(max-file-descriptors)Params: no params.
Returns: value - Long number of max file descriptors.
# Detect number of max file descriptors. * Params: no params. * Returns: _value_ - _Long_ number of max file descriptors.
(max-jvm-mem & {:keys [unit] :or {unit :mb}})Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Example: (max-jvm-mem) and (max-jvm-mem :unit :mb) returns max memory in megabytes.
Returns: Long - amount of max memory in bytes or in memory units.
# Returns the maximum amount of memory that the Java virtual machine will attempt to use.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Example:
(max-jvm-mem) and (max-jvm-mem :unit :mb) returns max memory in megabytes.
* Returns:
_Long_ - amount of max memory in bytes or in memory units.(meter registry metric-name n-events)Measure the rate of a ticking metric - a meter.
Measure the rate of a ticking metric - a meter.
(metric-registry)com.codahale.metrics.MetricRegistry.Params: no params.
Returns:
com.codahale.metrics.MetricRegistry insytance.
# Create new instance of `com.codahale.metrics.MetricRegistry`. * Params: no params. * Returns: _`com.codahale.metrics.MetricRegistry`_ insytance.
(open-file-descriptors)Params: no params.
Returns: value - Long number of open file descriptors.
# Detect number of open file descriptors. * Params: no params. * Returns: _value_ - _Long_ number of open file descriptors.
(process-cpu-load)Params: no params.
Returns: Float - current CPU load by process from 0.0.. N.
# Detect current CPU load by process. * Params: no params. * Returns: _Float_ - current CPU load by process from 0.0.. N.
(slf4j-reporter registry report-period report-units)Logger name is "middlesphere.metrics".
Params:
registry - com.codahale.metrics.MetricRegistry instance.
report-period - Long number of units for report period. (e.g. 10)
report-units - java.util.concurrent.TimeUnit instance (e.g. TimeUnit/SECONDS)
Returns: nil.
# Create SLF4j reporter for given registry and start it. Logger name is "middlesphere.metrics". * Params: **`registry`** - `com.codahale.metrics.MetricRegistry` instance. **`report-period`** - _Long_ number of units for report period. (e.g. 10) **`report-units`** - `java.util.concurrent.TimeUnit` instance (e.g. TimeUnit/SECONDS) * Returns: _nil_.
(statsd-reporter registry report-period report-units host port)Params:
registry - com.codahale.metrics.MetricRegistry instance.
report-period - Long number of units for report period. (e.g. 10)
report-units - java.util.concurrent.TimeUnit instance (e.g. TimeUnit/SECONDS)
host - String hostname or ip of StatsD server.
port - Long port of StatsD server.
Returns: nil.
# Create StatsD reporter for given registry and start it. * Params: **`registry`** - `com.codahale.metrics.MetricRegistry` instance. **`report-period`** - _Long_ number of units for report period. (e.g. 10) **`report-units`** - `java.util.concurrent.TimeUnit` instance (e.g. TimeUnit/SECONDS) **`host`** - `String` hostname or ip of StatsD server. **`port`** - `Long` port of StatsD server. * Returns: _nil_.
(system-cpu-load)Params: no params.
Returns: Float - current CPU load in system from 0.0.. N.
# Detect current CPU load in system. * Params: no params. * Returns: _Float_ - current CPU load in system from 0.0.. N.
(total-jvm-mem & {:keys [unit] :or {unit :mb}})The value returned by this method may vary over time, depending on the host environment.
Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Example: (total-jvm-mem) and (total-jvm-mem :unit :mb) returns total memory in megabytes.
Returns: Long - amount of total memory in bytes or in memory units.
# Returns the total amount of memory in the Java virtual machine.
The value returned by this method may vary over time, depending on the host environment.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Example:
(total-jvm-mem) and (total-jvm-mem :unit :mb) returns total memory in megabytes.
* Returns:
_Long_ - amount of total memory in bytes or in memory units.(total-swap-size & {:keys [unit] :or {unit :mb}})Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Returns: value - Long number of swap size in bytes or in memory units.
# Detect total swap size.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Returns:
_value_ - _Long_ number of swap size in bytes or in memory units.(used-jvm-mem & {:keys [unit] :or {unit :mb}})Params:
{:keys [unit]} - optional parameter from mem-units, default value is :mb
Returns: Long - amount of used memory in bytes or in memory units.
# Detect current amount of memory used by Java virtual machine.
* Params:
**`{:keys [unit]}`** - optional parameter from mem-units, default value is :mb
* Returns:
_Long_ - amount of used memory in bytes or in memory units.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |