Source

metrics-clojure / src / metrics / gauges.clj

Diff from to

File src/metrics/gauges.clj

 (ns metrics.gauges
-  (use [metrics.utils :only (metric-name)])
-  (import (com.yammer.metrics Metrics))
-  (import (com.yammer.metrics.core GaugeMetric)))
+  (:use [metrics.utils :only (metric-name)])
+  (:import (com.yammer.metrics Metrics))
+  (:import (com.yammer.metrics.core Gauge)))
 
 
 ; Create ----------------------------------------------------------------------
 (defmacro gauge [title & body]
   `(Metrics/newGauge (metric-name ~title)
-                     (proxy [GaugeMetric] []
+                     (proxy [Gauge] []
                        (value [] (do ~@body)))))
 
+
 ; Read ------------------------------------------------------------------------
 (defn gauge-fn [title f]
   (Metrics/newGauge (metric-name title)
-                    (proxy [GaugeMetric] []
+                    (proxy [Gauge] []
                       (value [] (f)))))
 
 
 ; Read ------------------------------------------------------------------------
-(defn value [^GaugeMetric g]
+(defn value [^Gauge g]
   (.value g))