Source

metrics-clojure / metrics-clojure-core / src / metrics / meters.clj

Diff from to

metrics-clojure-core/src/metrics/meters.clj

 (ns metrics.meters
-  (:use [metrics.utils :only (metric-name)])
+  (:use [metrics.utils :only (metric-name desugared-title)])
   (:import (com.yammer.metrics Metrics))
   (:import (com.yammer.metrics.core Meter))
   (:import (java.util.concurrent TimeUnit)))
 (defmacro defmeter
   "Define a new Meter metric with a given title and event type."
   [title event-type]
-  `(def ~title (meter ~(str title) ~event-type)))
+  (let [[s title] (desugared-title title)]
+    `(def ~s (meter ~title ~event-type))))
 
 
 ; Read ------------------------------------------------------------------------