Skip to content

Commit

Permalink
fmtfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Nov 18, 2024
1 parent b822adc commit 6ef14c9
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 @@ -168,18 +168,18 @@
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)
filtered-metrics (numeric-metrics metrics metrics-filter)]
(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 filtered-metrics)
(assoc ctx :metrics-summary {:total (count metrics)
Expand Down

0 comments on commit 6ef14c9

Please sign in to comment.