(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
(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.
(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
(build-graphite-sender graphite-config domain)
Inputs: [graphite-config :- GraphiteReporterConfig domain :- schema/Keyword] Returns: GraphiteSender
Inputs: [graphite-config :- GraphiteReporterConfig domain :- schema/Keyword] Returns: GraphiteSender
(build-metric-filter metrics-allowed)
Inputs: [metrics-allowed :- #{schema/Str}] Returns: AllowedNamesMetricFilter
Inputs: [metrics-allowed :- #{schema/Str}] Returns: AllowedNamesMetricFilter
(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).
(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.
(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.
(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
(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.
(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
(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.
(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.
(jmx-reporter registry domain)
Inputs: [registry :- MetricRegistry domain :- (schema/maybe schema/Keyword)] Returns: JmxReporter
Inputs: [registry :- MetricRegistry domain :- (schema/maybe schema/Keyword)] Returns: JmxReporter
(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.
(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.
(stop context)
Inputs: [context :- RegistryContext]
Inputs: [context :- RegistryContext]
(stop-all service-context)
Inputs: [service-context :- MetricsServiceContext]
Inputs: [service-context :- MetricsServiceContext]
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close