Liking cljdoc? Tell your friends :D
Clojure only.

metrics.reporters.cloudwatch

Functions for creating and executing CloudWatch reporters.

Functions for creating and executing CloudWatch reporters.
raw docstring

reporterclj

(reporter opts)
(reporter reg
          {:keys [namespace client filter dimensions timestamp-local
                  type-dim-name type-dim-val-gauge type-dim-val-counter-count
                  type-dim-val-meter-count type-dim-val-histo-samples
                  type-dim-val-histo-stats type-dim-val-timer-samples
                  type-dim-val-timer-stats reporter-filter]
           :as opts})

Builds a CloudWatch reporter.

reg is a metrics registry. If a registry is not provided, the reporter will use the default registry from the metrics-clojure library.

opts is a map containing configuration data for the reporter. :namespace is a required key, but all others are optional. The options include:

  • :namespace - the name of the CloudWatch custom namespace

  • :client - an AmazonCloudWatchAsync object If one is not provided, a client is created using a credentials provider chain that searches for credentials in the following order: 1. Environment vars AWS_ACCESS_KEY and AWS_SECRET_KEY 2. Java system properties aws.accessKeyId and aws.secretKey 3. Credential profiles file at the default location (~/.aws/credentials) 4. Instance profile credentials delivered through the EC2 metadata service

  • :filter - a com.codahale.metrics.MetricFilter Only the metrics that pass the filter (i.e., the filter returns true) will be sent to CloudWatch. Defaults to always return true.

  • :dimensions - a map of name/value pairs of dims appended to all metrics

  • :timestamp-local - a bool indicating whether metrics are timestamped locally If true metric data is timestamped locally, else CloudWatch will timestamp the metric upon receipt. Defaults to false.

  • :reporter-filter - a predicate that indicates whether to submit a metric The function will be called with a com.amazonaws.services.cloudwatch.model.MetricDatum just before submitting to CloudWatch. If the predicate returns true, then the metric will be submitted, otherwise the metric is excluded from the submission. Defaults to always return true.

  • Metric type dimension names The following key names describe the name of the 'metric type' dimension for a few different cases, described by the key name. Each type has a distinct default value based on its type (e.g., :type-dim-val-gauge defaults to 'gauge'.

    • :type-dim-name
    • :type-dim-val-gauge
    • :type-dim-val-counter-count
    • :type-dim-val-meter-count
    • :type-dim-val-histo-samples
    • :type-dim-val-histo-stats
    • :type-dim-val-timer-samples
    • :type-dim-val-timer-stats
Builds a CloudWatch reporter.

`reg` is a metrics registry. If a registry is not provided, the reporter will
use the default registry from the metrics-clojure library.

`opts` is a map containing configuration data for the reporter. `:namespace`
is a required key, but all others are optional. The options include:

* `:namespace` - the name of the CloudWatch custom namespace

* `:client` - an `AmazonCloudWatchAsync` object
    If one is not provided, a client is created using a credentials provider
    chain that searches for credentials in the following order:
      1. Environment vars AWS_ACCESS_KEY and AWS_SECRET_KEY
      2. Java system properties aws.accessKeyId and aws.secretKey
      3. Credential profiles file at the default location (~/.aws/credentials)
      4. Instance profile credentials delivered through the EC2 metadata service

* `:filter` - a `com.codahale.metrics.MetricFilter`
    Only the metrics that pass the filter (i.e., the filter returns true) will
    be sent to CloudWatch. Defaults to always return true.

* `:dimensions` - a map of name/value pairs of dims appended to all metrics

* `:timestamp-local` - a bool indicating whether metrics are timestamped locally
    If true metric data is timestamped locally, else CloudWatch will timestamp
    the metric upon receipt. Defaults to false.

* `:reporter-filter` - a predicate that indicates whether to submit a metric
    The function will be called with a `com.amazonaws.services.cloudwatch.model.MetricDatum`
    just before submitting to CloudWatch. If the predicate returns true, then
    the metric will be submitted, otherwise the metric is excluded from the
    submission. Defaults to always return true.

* Metric type dimension names
    The following key names describe the name of the 'metric type' dimension
    for a few different cases, described by the key name. Each type has a
    distinct default value based on its type (e.g., `:type-dim-val-gauge`
    defaults to 'gauge'.

    - `:type-dim-name`
    - `:type-dim-val-gauge`
    - `:type-dim-val-counter-count`
    - `:type-dim-val-meter-count`
    - `:type-dim-val-histo-samples`
    - `:type-dim-val-histo-stats`
    - `:type-dim-val-timer-samples`
    - `:type-dim-val-timer-stats`
sourceraw docstring

startclj

(start r seconds)

Report all metrics to CloudWatch periodically.

Report all metrics to CloudWatch periodically.
sourceraw docstring

stopclj

(stop r)

Stops reporting.

Stops reporting.
sourceraw docstring

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

× close