Skip to content

Commit

Permalink
fmtfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Nov 13, 2024
1 parent 380a59a commit d3af2cc
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/clojure/io/factorhouse/kpow/agent.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@
(defn apply-metric-filters
[^MetricName metric-name filters]
(reduce
(fn [acc ^MetricFilter$FilterCriteria filter-criteria]
(let [metric-filter-type (.getFilterType filter-criteria)
predicate (.getPredicate filter-criteria)]
(if (.test predicate metric-name)
(reduced
(case (.name metric-filter-type)
"ACCEPT" true
"DENY" false))
acc)))
nil
filters))
(fn [acc ^MetricFilter$FilterCriteria filter-criteria]
(let [metric-filter-type (.getFilterType filter-criteria)
predicate (.getPredicate filter-criteria)]
(if (.test predicate metric-name)
(reduced
(case (.name metric-filter-type)
"ACCEPT" true
"DENY" false))
acc)))
nil
filters))

(defn numeric-metrics
[metrics ^MetricFilter metrics-filter]
Expand Down Expand Up @@ -166,17 +166,17 @@
application-id (application-id metrics)
taxon (.getTaxon key-strategy client-id application-id)
ctx (assoc ctx
:captured (System/currentTimeMillis)
:client-id client-id
:application-id application-id
:taxon taxon)]
:captured (System/currentTimeMillis)
:client-id client-id
:application-id application-id
:taxon taxon)]
(when (nil? application-id)
(throw (Exception. "Cannot infer application id from metrics returned from KafkaStreams instance. Expected metric \"application-id\" in the metrics registry.")))
(when (nil? client-id)
(throw (Exception.
(format "Cannot infer client id from metrics returned from KafkaStreams instance. Got: client-id %s and application-id %s"
(client-id-tag metrics)
application-id))))
(format "Cannot infer client id from metrics returned from KafkaStreams instance. Got: client-id %s and application-id %s"
(client-id-tag metrics)
application-id))))
(snapshot-send ctx snapshot)
(metrics-send ctx (numeric-metrics metrics metrics-filter))
ctx))))
Expand Down

0 comments on commit d3af2cc

Please sign in to comment.