Liking cljdoc? Tell your friends :D

puppetlabs.trapperkeeper.services.metrics.metrics-core


add-graphite-reporterclj

(add-graphite-reporter registry-context graphite-config metrics-allowed domain)

Inputs: [registry-context :- RegistryContext graphite-config :- (schema/maybe GraphiteReporterConfig) metrics-allowed :- #{schema/Str} domain :- schema/Keyword] Returns: RegistryContext

Adds a graphite reporter to the given registry context if graphite is enabled in the configuration. Starts up a thread which reports the metrics to graphite on the interval specified in :update-interval-seconds

Inputs: [registry-context :- RegistryContext graphite-config :- (schema/maybe GraphiteReporterConfig) metrics-allowed :- #{schema/Str} domain :- schema/Keyword]
Returns: RegistryContext

Adds a graphite reporter to the given registry context if graphite
is enabled in the configuration. Starts up a thread which reports the metrics
to graphite on the interval specified in :update-interval-seconds
sourceraw docstring

add-graphite-reportersclj

(add-graphite-reporters service-context)

Inputs: [service-context :- MetricsServiceContext] Returns: MetricsServiceContext

Add Graphite reporters to all registries with Graphite enabled in the config, using the configured settings for each registry. Returns an updated service context. Should be called from start of the metrics-service.

Inputs: [service-context :- MetricsServiceContext]
Returns: MetricsServiceContext

Add Graphite reporters to all registries with Graphite enabled in the config, using the
configured settings for each registry. Returns an updated service context. Should be called from
`start` of the metrics-service.
sourceraw docstring

BaseGraphiteReporterConfigclj

source

build-graphite-reporterclj

(build-graphite-reporter registry metrics-allowed graphite-sender)

Inputs: [registry :- MetricRegistry metrics-allowed :- #{schema/Str} graphite-sender :- GraphiteSender] Returns: GraphiteReporter

Constructs a GraphiteReporter instance for the given registry, with the given allowed metrics, and using the given graphite-sender

Inputs: [registry :- MetricRegistry metrics-allowed :- #{schema/Str} graphite-sender :- GraphiteSender]
Returns: GraphiteReporter

Constructs a GraphiteReporter instance for the given registry, with the given allowed metrics,
and using the given graphite-sender
sourceraw docstring

build-graphite-senderclj

(build-graphite-sender graphite-config domain)

Inputs: [graphite-config :- GraphiteReporterConfig domain :- schema/Keyword] Returns: GraphiteSender

Inputs: [graphite-config :- GraphiteReporterConfig domain :- schema/Keyword]
Returns: GraphiteSender
sourceraw docstring

build-handlerclj

(build-handler path)
source

build-metric-filterclj

(build-metric-filter metrics-allowed)

Inputs: [metrics-allowed :- #{schema/Str}] Returns: AllowedNamesMetricFilter

Inputs: [metrics-allowed :- #{schema/Str}]
Returns: AllowedNamesMetricFilter
sourceraw docstring

construct-metric-namesclj

(construct-metric-names prefix metric-names)

Inputs: [prefix :- schema/Str metric-names :- [schema/Str]] Returns: #{schema/Str}

Prefixes the metric prefix to each metric name. Returns a set of metric names (duplicates are removed).

Inputs: [prefix :- schema/Str metric-names :- [schema/Str]]
Returns: #{schema/Str}

Prefixes the metric prefix to each metric name. Returns a set of metric names (duplicates are
removed).
sourceraw docstring

create-initial-service-contextclj

(create-initial-service-context metrics-config)

Inputs: [metrics-config :- MetricsConfig] Returns: MetricsServiceContext

Create the initial service context for the metrics-service. Initialize all registries in the config, add them to the registries atom, and include that in the service context map, along with an empty atom for registry-settings and the metrics config.

Inputs: [metrics-config :- MetricsConfig]
Returns: MetricsServiceContext

Create the initial service context for the metrics-service. Initialize all registries in the
config, add them to the `registries` atom, and include that in the service context map, along with
an empty atom for `registry-settings` and the metrics config.
sourceraw docstring

default-middlewareclj

(default-middleware)

Inputs: []

Inputs: []
sourceraw docstring

DefaultRegistrySettingsclj

source

get-graphite-configclj

(get-graphite-config config domain)

Inputs: [config :- MetricsConfig domain :- schema/Keyword] Returns: (schema/maybe GraphiteReporterConfig)

Merge together the graphite config for the registry with the global graphite config.

Inputs: [config :- MetricsConfig domain :- schema/Keyword]
Returns: (schema/maybe GraphiteReporterConfig)

Merge together the graphite config for the registry with the global graphite config.
sourceraw docstring

get-metric-prefixclj

(get-metric-prefix metrics-config domain)

Inputs: [metrics-config :- MetricsConfig domain :- schema/Keyword] Returns: schema/Str

Determines what the metric prefix should be. If a metric-prefix is set in the config, we use that. Else default to the server-id

Inputs: [metrics-config :- MetricsConfig domain :- schema/Keyword]
Returns: schema/Str

Determines what the metric prefix should be.
If a metric-prefix is set in the config, we use that. Else default to the server-id
sourceraw docstring

get-metrics-allowedclj

(get-metrics-allowed metrics-config registry-settings domain)

Inputs: [metrics-config :- MetricsConfig registry-settings :- #:schema{Any DefaultRegistrySettings} domain :- schema/Keyword] Returns: #{schema/Str}

Get the metrics allowed for the registry. Looks at the metrics-allowed registered for the registry in the registry settings atom using the update-registry-settings function as well as the metrics-allowed listed in the config file under the :metrics-allowed key. Merges these lists together and then adds the metrics prefix to them, returning a set of prefixed allowed metrics.

Inputs: [metrics-config :- MetricsConfig registry-settings :- #:schema{Any DefaultRegistrySettings} domain :- schema/Keyword]
Returns: #{schema/Str}

Get the metrics allowed for the registry. Looks at the metrics-allowed registered for the
registry in the registry settings atom using the `update-registry-settings` function as well
as the metrics-allowed listed in the config file under the `:metrics-allowed` key. Merges these
lists together and then adds the metrics prefix to them, returning a set of prefixed allowed
metrics.
sourceraw docstring

get-or-initialize-registry-contextclj

(get-or-initialize-registry-context {:keys [registries metrics-config]} domain)

Inputs: [{:keys [registries metrics-config]} :- MetricsServiceContext domain :- schema/Keyword] Returns: RegistryContext

If a registry exists within the service context for a given domain already, return it. Otherwise initialize a new registry for that domain and return it. Modifies the registries atom in the service context to add the new registry

Inputs: [{:keys [registries metrics-config]} :- MetricsServiceContext domain :- schema/Keyword]
Returns: RegistryContext

If a registry exists within the service context for a given domain
already, return it.
Otherwise initialize a new registry for that domain and return it.
Modifies the registries atom in the service context to add the new registry
sourceraw docstring

GraphiteRegistryReporterConfigclj

source

GraphiteReporterConfigclj

source

initialize-registries-from-configclj

(initialize-registries-from-config metrics-config)

Inputs: [metrics-config :- MetricsConfig] Returns: #:schema{Any RegistryContext}

Read through the config and create a MetricsRegistry (+ JMX reporter if configured) for every registry mentioned in it. Also create the default registry if not mentioned in the config. Should be called from init of the metrics-service.

Inputs: [metrics-config :- MetricsConfig]
Returns: #:schema{Any RegistryContext}

Read through the config and create a MetricsRegistry (+ JMX reporter if configured) for every
registry mentioned in it. Also create the default registry if not mentioned in the config. Should
be called from `init` of the metrics-service.
sourceraw docstring

initialize-registry-contextclj

(initialize-registry-context config domain)

Inputs: [config :- (schema/maybe RegistryConfig) domain :- schema/Keyword] Returns: RegistryContext

Create initial registry context. This will include a MetricsRegistry and a JMX reporter, but not a Graphite reporter.

Inputs: [config :- (schema/maybe RegistryConfig) domain :- schema/Keyword]
Returns: RegistryContext

Create initial registry context. This will include a MetricsRegistry and a
JMX reporter, but not a Graphite reporter.
sourceraw docstring

jmx-reporterclj

(jmx-reporter registry domain)

Inputs: [registry :- MetricRegistry domain :- (schema/maybe schema/Keyword)] Returns: JmxReporter

Inputs: [registry :- MetricRegistry domain :- (schema/maybe schema/Keyword)]
Returns: JmxReporter
sourceraw docstring

JmxReporterConfigclj

source

JolokiaApiConfigclj

source

lock-registry-settingsclj

(lock-registry-settings context)

Inputs: [context :- MetricsServiceContext] Returns: MetricsServiceContext

Switch the can-update-registry-settings? boolean to false to show that it is after the init phase and registry settings can no longer be set.

Inputs: [context :- MetricsServiceContext]
Returns: MetricsServiceContext

Switch the `can-update-registry-settings?` boolean to false to show that it is after the `init`
phase and registry settings can no longer be set.
sourceraw docstring

maybe-add-default-to-configclj

(maybe-add-default-to-config metrics-config)

Inputs: [metrics-config :- MetricsConfig] Returns: MetricsConfig

Add a :default key with an empty map as the value to the registries config if it is not present.

Inputs: [metrics-config :- MetricsConfig]
Returns: MetricsConfig

Add a `:default` key with an empty map as the value to the registries config if it is not
present.
sourceraw docstring

MbeansApiConfigclj

source

MetricsConfigclj

source

MetricsServiceContextclj

source

RegistriesConfigclj

source

RegistryConfigclj

source

RegistryContextclj

source

RegistryReportersConfigclj

source

ReportersConfigclj

source

stopclj

(stop context)

Inputs: [context :- RegistryContext]

Inputs: [context :- RegistryContext]
sourceraw docstring

stop-allclj

(stop-all service-context)

Inputs: [service-context :- MetricsServiceContext]

Inputs: [service-context :- MetricsServiceContext]
sourceraw docstring

update-registry-settingsclj

(update-registry-settings context domain settings)

Inputs: [context :- MetricsServiceContext domain :- schema/Keyword settings :- DefaultRegistrySettings] Returns: #:schema{Any DefaultRegistrySettings}

Update the registry-settings atom for the given domain. If called again for the same domain, the new settings will be merged in, and lists such as :default-metrics-allowed, will be concat'd together.

Inputs: [context :- MetricsServiceContext domain :- schema/Keyword settings :- DefaultRegistrySettings]
Returns: #:schema{Any DefaultRegistrySettings}

Update the `registry-settings` atom for the given domain. If called again for the same domain,
the new settings will be merged in, and lists such as :default-metrics-allowed, will be concat'd
together.
sourceraw docstring

WebserviceConfigclj

source

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

× close