Skip to content

Commit

Permalink
fixes cljfmt errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theanirudhvyas committed Sep 30, 2019
1 parent cb848a5 commit 13fc1db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/ziggurat/metrics.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
histogram ^Histogram (mk-histogram metric-namespace "all" (remove-topic-tag-for-old-namespace additional-tags metric-namespaces))]
(.update histogram (get-int val)))))

(defn report-time report-histogram) ;; for backward compatibility
(def report-time report-histogram) ;; for backward compatibility

(defn multi-ns-report-time [nss time-val additional-tags]
(doseq [ns nss]
Expand Down
32 changes: 16 additions & 16 deletions test/ziggurat/mapper_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
successfully-reported-time? (atom false)
expected-metric "success"]
(with-redefs [metrics/increment-count (fn [metric-namespaces metric additional-tags]
(when (and (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [default-namespace]))
(= metric expected-metric)
(= additional-tags expected-additional-tags))
(reset! successfully-processed? true)))
(when (and (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [default-namespace]))
(= metric expected-metric)
(= additional-tags expected-additional-tags))
(reset! successfully-processed? true)))
metrics/report-histogram (fn [metric-namespaces _ _]
(when (or (= metric-namespaces expected-report-time-namespaces)
(= metric-namespaces [report-time-namespace]))
(reset! successfully-reported-time? true)))]
(when (or (= metric-namespaces expected-report-time-namespaces)
(= metric-namespaces [report-time-namespace]))
(reset! successfully-reported-time? true)))]
((mapper-func (constantly :success) expected-topic-entity-name []) message)
(is @successfully-processed?)
(is @successfully-reported-time?))))
Expand Down Expand Up @@ -107,11 +107,11 @@
execution-time-namesapce "handler-fn-execution-time"
expected-metric-namespaces [service-name "default" execution-time-namesapce]]
(with-redefs [metrics/report-histogram (fn [metric-namespaces _ _]
(is (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [execution-time-namesapce])))
(when (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [execution-time-namesapce]))
(reset! reported-execution-time? true)))]
(is (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [execution-time-namesapce])))
(when (or (= metric-namespaces expected-metric-namespaces)
(= metric-namespaces [execution-time-namesapce]))
(reset! reported-execution-time? true)))]

((mapper-func (constantly :success) expected-topic-entity-name []) message)
(is @reported-execution-time?))))))
Expand Down Expand Up @@ -180,8 +180,8 @@
(let [reported-execution-time? (atom false)
execution-time-namesapce "execution-time"]
(with-redefs [metrics/report-histogram (fn [metric-namespaces _ _]
(when (or (= metric-namespaces [service-name expected-topic-entity-name channel-name execution-time-namesapce])
(= metric-namespaces [execution-time-namesapce]))
(reset! reported-execution-time? true)))]
(when (or (= metric-namespaces [service-name expected-topic-entity-name channel-name execution-time-namesapce])
(= metric-namespaces [execution-time-namesapce]))
(reset! reported-execution-time? true)))]
((channel-mapper-func (constantly :success) topic channel) message)
(is @reported-execution-time?))))))

0 comments on commit 13fc1db

Please sign in to comment.